From 9f0813fd0147da3977e9e1ed56da3afd9aaf1721 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:04:06 -0700 Subject: [PATCH 1/7] chore(deps-dev): bump ruff from 0.6.9 to 0.7.1 in /requirements (#697) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.9 to 0.7.1. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.6.9...0.7.1) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index cbc2770d4..c80954ae5 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -11,4 +11,4 @@ pyelftools~=0.31 # Used to verify the generated Go binary architecture in integr # formatter black==24.10.0; python_version>="3.9" black==24.8.0; python_version<"3.9" -ruff==0.6.9 +ruff==0.7.1 From eedc02650a4edd69faff1f82decfba4a076b8997 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:04:13 -0700 Subject: [PATCH 2/7] chore(deps-dev): bump coverage from 7.6.3 to 7.6.4 in /requirements (#695) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.3 to 7.6.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.3...7.6.4) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index c80954ae5..696612142 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,4 @@ -coverage==7.6.3; python_version>="3.9" +coverage==7.6.4; python_version>="3.9" coverage==7.6.1; python_version<"3.9" flake8==3.8.4 pytest-cov==5.0.0 From c2f1ce2144cb5118cc46a116d138ef4bd0d4c737 Mon Sep 17 00:00:00 2001 From: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> Date: Thu, 7 Nov 2024 08:53:59 -0800 Subject: [PATCH 3/7] feat: Add python3.13 runtime support (#691) * feat: Add python3.13 runime support * skip unknown_package_name test on Windows * skip test using skipTest fn --- .github/workflows/build.yml | 7 +++++ aws_lambda_builders/validator.py | 1 + .../workflows/python_pip/DESIGN.md | 2 +- .../workflows/python_pip/packager.py | 3 ++- setup.py | 1 + .../workflows/python_pip/test_python_pip.py | 27 ++++++++++--------- .../testdata/requirements-numpy.txt | 3 ++- .../workflows/python_pip/test_packager.py | 3 +++ 8 files changed, 32 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d18d33bda..763ff55a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,6 +123,7 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13" npm: - 8 - 9 @@ -156,6 +157,7 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -183,6 +185,7 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -213,6 +216,7 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -265,6 +269,7 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -293,6 +298,7 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -320,6 +326,7 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 diff --git a/aws_lambda_builders/validator.py b/aws_lambda_builders/validator.py index 641bef650..adee8d7ec 100644 --- a/aws_lambda_builders/validator.py +++ b/aws_lambda_builders/validator.py @@ -18,6 +18,7 @@ "python3.10": [ARM64, X86_64], "python3.11": [ARM64, X86_64], "python3.12": [ARM64, X86_64], + "python3.13": [ARM64, X86_64], "ruby3.2": [ARM64, X86_64], "ruby3.3": [ARM64, X86_64], "java8": [ARM64, X86_64], diff --git a/aws_lambda_builders/workflows/python_pip/DESIGN.md b/aws_lambda_builders/workflows/python_pip/DESIGN.md index 1767e32d3..58f1ef308 100644 --- a/aws_lambda_builders/workflows/python_pip/DESIGN.md +++ b/aws_lambda_builders/workflows/python_pip/DESIGN.md @@ -49,7 +49,7 @@ def build_dependencies(artifacts_dir_path, :type runtime: str :param runtime: Python version to build dependencies for. This can - either be python3.8, python3.9, python3.10, python3.11 or python3.12. These are + either be python3.8, python3.9, python3.10, python3.11, python3.12 or python3.13. These are currently the only supported values. :type ui: :class:`lambda_builders.actions.python_pip.utils.UI` diff --git a/aws_lambda_builders/workflows/python_pip/packager.py b/aws_lambda_builders/workflows/python_pip/packager.py index 3fc48427a..a3d4bf0d8 100644 --- a/aws_lambda_builders/workflows/python_pip/packager.py +++ b/aws_lambda_builders/workflows/python_pip/packager.py @@ -86,6 +86,7 @@ def get_lambda_abi(runtime): "python3.10": "cp310", "python3.11": "cp311", "python3.12": "cp312", + "python3.13": "cp313", } if runtime not in supported: @@ -100,7 +101,7 @@ def __init__(self, runtime, python_exe, osutils=None, dependency_builder=None, a :type runtime: str :param runtime: Python version to build dependencies for. This can - either be python3.8, python3.9, python3.10, python3.11 or python3.12. These are currently the + either be python3.8, python3.9, python3.10, python3.11, python3.12 or python3.13. These are currently the only supported values. :type osutils: :class:`lambda_builders.utils.OSUtils` diff --git a/setup.py b/setup.py index d10bb6cf0..d6eedd07a 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,7 @@ def read_version(): "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Internet", "Topic :: Software Development :: Build Tools", "Topic :: Utilities", diff --git a/tests/integration/workflows/python_pip/test_python_pip.py b/tests/integration/workflows/python_pip/test_python_pip.py index 9ceed3d13..162921645 100644 --- a/tests/integration/workflows/python_pip/test_python_pip.py +++ b/tests/integration/workflows/python_pip/test_python_pip.py @@ -18,7 +18,7 @@ logger = logging.getLogger("aws_lambda_builders.workflows.python_pip.workflow") IS_WINDOWS = platform.system().lower() == "windows" NOT_ARM = platform.processor() != "aarch64" -ARM_RUNTIMES = {"python3.8", "python3.9", "python3.10", "python3.11", "python3.12"} +ARM_RUNTIMES = {"python3.8", "python3.9", "python3.10", "python3.11", "python3.12", "python3.13"} @parameterized_class(("experimental_flags",), [([]), ([EXPERIMENTAL_FLAG_BUILD_PERFORMANCE])]) @@ -64,6 +64,7 @@ def setUp(self): "python3.10": "python3.9", "python3.11": "python3.10", "python3.12": "python3.11", + "python3.13": "python3.12", } def tearDown(self): @@ -96,9 +97,9 @@ def test_must_build_python_project(self): experimental_flags=self.experimental_flags, ) - if self.runtime in ("python3.12"): - self.check_architecture_in("numpy-1.26.1.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"]) - expected_files = self.test_data_files.union({"numpy", "numpy-1.26.1.dist-info", "numpy.libs"}) + if self.runtime in ("python3.12", "python3.13"): + self.check_architecture_in("numpy-2.1.2.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"]) + expected_files = self.test_data_files.union({"numpy", "numpy-2.1.2.dist-info", "numpy.libs"}) elif self.runtime in ("python3.10", "python3.11"): self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"]) expected_files = self.test_data_files.union({"numpy", "numpy-1.23.5.dist-info", "numpy.libs"}) @@ -126,10 +127,10 @@ def test_must_build_python_project_python3_binary(self): executable_search_paths=[executable_dir], ) - if self.runtime in ("python3.12"): - self.check_architecture_in("numpy-1.26.1.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"]) - expected_files = self.test_data_files.union({"numpy", "numpy-1.26.1.dist-info", "numpy.libs"}) - elif self.runtime in ("python3.10", "python3.11", "python3.12"): + if self.runtime in ("python3.12", "python3.13"): + self.check_architecture_in("numpy-2.1.2.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"]) + expected_files = self.test_data_files.union({"numpy", "numpy-2.1.2.dist-info", "numpy.libs"}) + elif self.runtime in ("python3.10", "python3.11"): self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"]) expected_files = self.test_data_files.union({"numpy", "numpy-1.23.5.dist-info", "numpy.libs"}) else: @@ -174,15 +175,15 @@ def test_must_build_python_project_with_arm_architecture(self): experimental_flags=self.experimental_flags, ) expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.20.3.dist-info"}) - if self.runtime in ("python3.12"): - expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.26.1.dist-info"}) + if self.runtime in ("python3.12", "python3.13"): + expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-2.1.2.dist-info"}) if self.runtime in ("python3.10", "python3.11"): expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.23.5.dist-info"}) output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - if self.runtime in ("python3.12"): - self.check_architecture_in("numpy-1.26.1.dist-info", ["manylinux2014_aarch64"]) + if self.runtime in ("python3.12", "python3.13"): + self.check_architecture_in("numpy-2.1.2.dist-info", ["manylinux2014_aarch64"]) elif self.runtime in ("python3.10", "python3.11"): self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_aarch64"]) else: @@ -247,6 +248,8 @@ def test_must_resolve_local_dependency(self): self.assertIn(f, output_files) def test_must_resolve_unknown_package_name(self): + if IS_WINDOWS and self.runtime == "python3.13": + self.skipTest("Skip test as pip install inflate64 does not work on Windows with Python 3.13") self.builder.build( self.source_dir, self.artifacts_dir, diff --git a/tests/integration/workflows/python_pip/testdata/requirements-numpy.txt b/tests/integration/workflows/python_pip/testdata/requirements-numpy.txt index 486c6b57f..3682fe698 100644 --- a/tests/integration/workflows/python_pip/testdata/requirements-numpy.txt +++ b/tests/integration/workflows/python_pip/testdata/requirements-numpy.txt @@ -2,4 +2,5 @@ numpy==1.20.3; python_version == '3.8' numpy==1.20.3; python_version == '3.9' numpy==1.23.5; python_version == '3.10' numpy==1.23.5; python_version == '3.11' -numpy==1.26.1; python_version == '3.12' +numpy==2.1.2; python_version == '3.12' +numpy==2.1.2; python_version == '3.13' diff --git a/tests/unit/workflows/python_pip/test_packager.py b/tests/unit/workflows/python_pip/test_packager.py index 928387ddd..a2ce11f65 100644 --- a/tests/unit/workflows/python_pip/test_packager.py +++ b/tests/unit/workflows/python_pip/test_packager.py @@ -106,6 +106,9 @@ def test_get_lambda_abi_python311(self): def test_get_lambda_abi_python312(self): assert "cp312" == get_lambda_abi("python3.12") + def test_get_lambda_abi_python313(self): + assert "cp313" == get_lambda_abi("python3.13") + class TestPythonPipDependencyBuilder(object): def test_can_call_dependency_builder(self, osutils): From 568acc444d0f772d8876156e03ed4509cc0bee52 Mon Sep 17 00:00:00 2001 From: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:36:51 -0800 Subject: [PATCH 4/7] chore: version bump to 1.51.0 (#701) --- aws_lambda_builders/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws_lambda_builders/__init__.py b/aws_lambda_builders/__init__.py index d28d17012..60a006248 100644 --- a/aws_lambda_builders/__init__.py +++ b/aws_lambda_builders/__init__.py @@ -5,5 +5,5 @@ # Changing version will trigger a new release! # Please make the version change as the last step of your development. -__version__ = "1.50.0" +__version__ = "1.51.0" RPC_PROTOCOL_VERSION = "0.3" From 69a19ad5d27124c416ecd84a938434f9e5526ab1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:36:07 -0800 Subject: [PATCH 5/7] chore(deps-dev): bump pytest-cov from 5.0.0 to 6.0.0 in /requirements (#698) * chore(deps-dev): bump pytest-cov from 5.0.0 to 6.0.0 in /requirements Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 5.0.0 to 6.0.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v5.0.0...v6.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Pin pytest-cov versions based on the python version --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- requirements/dev.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 696612142..58b84823c 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,7 +1,8 @@ coverage==7.6.4; python_version>="3.9" coverage==7.6.1; python_version<"3.9" flake8==3.8.4 -pytest-cov==5.0.0 +pytest-cov==6.0.0; python_version>="3.9" +pytest-cov==5.0.0; python_version<"3.9" # Test requirements pytest>=6.1.1 From 2b1aee123386030e8b6d969d5ab5c48af271afd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:03:15 -0800 Subject: [PATCH 6/7] chore(deps-dev): bump ruff from 0.7.1 to 0.7.3 in /requirements (#702) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.1 to 0.7.3. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.7.1...0.7.3) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 58b84823c..6aa7c6a50 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -12,4 +12,4 @@ pyelftools~=0.31 # Used to verify the generated Go binary architecture in integr # formatter black==24.10.0; python_version>="3.9" black==24.8.0; python_version<"3.9" -ruff==0.7.1 +ruff==0.7.3 From 2a2d6b72fae684efd379f19e7a0149715bcc4a33 Mon Sep 17 00:00:00 2001 From: Jeffry Angtoni Date: Sat, 16 Nov 2024 05:15:44 +0700 Subject: [PATCH 7/7] Fix: Support JVM version string from old (< v8.9) and new (>= v8.9) gradle version (#683) * fix(validator): support version string from old and newest gradle * fix(test): fix unit test * test: add more version and runtime to the test * refactor(validator): use full label instead * fix(validator): use in operator to check JVM substring --------- Co-authored-by: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> --- .../workflows/java_gradle/gradle_validator.py | 2 +- .../java_gradle/test_gradle_validator.py | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/aws_lambda_builders/workflows/java_gradle/gradle_validator.py b/aws_lambda_builders/workflows/java_gradle/gradle_validator.py index 2972e75b2..5107b9c2d 100644 --- a/aws_lambda_builders/workflows/java_gradle/gradle_validator.py +++ b/aws_lambda_builders/workflows/java_gradle/gradle_validator.py @@ -83,5 +83,5 @@ def _get_jvm_string(self, gradle_path): for line in stdout.splitlines(): l_dec = decode(line) - if l_dec.startswith("JVM"): + if "JVM" in l_dec: return l_dec diff --git a/tests/unit/workflows/java_gradle/test_gradle_validator.py b/tests/unit/workflows/java_gradle/test_gradle_validator.py index 2815b4f68..f51bf5c9f 100644 --- a/tests/unit/workflows/java_gradle/test_gradle_validator.py +++ b/tests/unit/workflows/java_gradle/test_gradle_validator.py @@ -78,6 +78,40 @@ def test_emits_warning_when_version_string_not_found(self): validator.validate(runtime_path=self.runtime_path) self.mock_log.warning.assert_called_with(GradleValidator.VERSION_STRING_WARNING, self.runtime_path) + @parameterized.expand( + [ + ("1.8.0", "java8"), + ("11.0.0", "java11"), + ("17.0.0", "java17"), + ("21.0.0", "java21"), + ] + ) + def test_does_not_emit_warning_for_version_string_in_gradle_lt_8_9(self, version, runtime): + version_string = f"JVM: {version}".encode() + self.mock_os_utils.popen.side_effect = [FakePopen(stdout=version_string, returncode=0)] + validator = GradleValidator( + runtime=runtime, architecture=self.architecture, os_utils=self.mock_os_utils, log=self.mock_log + ) + validator.validate(runtime_path=self.runtime_path) + self.mock_log.warning.assert_not_called() + + @parameterized.expand( + [ + ("1.8.0", "java8"), + ("11.0.0", "java11"), + ("17.0.0", "java17"), + ("21.0.0", "java21"), + ] + ) + def test_does_not_emit_warning_for_version_string_in_gradle_ge_8_9(self, version, runtime): + version_string = f"Launcher JVM: {version}".encode() + self.mock_os_utils.popen.side_effect = [FakePopen(stdout=version_string, returncode=0)] + validator = GradleValidator( + runtime=runtime, architecture=self.architecture, os_utils=self.mock_os_utils, log=self.mock_log + ) + validator.validate(runtime_path=self.runtime_path) + self.mock_log.warning.assert_not_called() + @parameterized.expand( [ ("11.0.0", "java11"),