Skip to content

Commit b98cef7

Browse files
Merge branch 'develop'
2 parents f9ffd0c + 568acc4 commit b98cef7

File tree

15 files changed

+70
-32
lines changed

15 files changed

+70
-32
lines changed

.github/workflows/build.yml

+7
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ jobs:
123123
- "3.10"
124124
- "3.11"
125125
- "3.12"
126+
- "3.13"
126127
npm:
127128
- 8
128129
- 9
@@ -156,6 +157,7 @@ jobs:
156157
- "3.10"
157158
- "3.11"
158159
- "3.12"
160+
- "3.13"
159161
steps:
160162
- uses: actions/checkout@v4
161163
- uses: actions/setup-python@v5
@@ -183,6 +185,7 @@ jobs:
183185
- "3.10"
184186
- "3.11"
185187
- "3.12"
188+
- "3.13"
186189
steps:
187190
- uses: actions/checkout@v4
188191
- uses: actions/setup-python@v5
@@ -213,6 +216,7 @@ jobs:
213216
- "3.10"
214217
- "3.11"
215218
- "3.12"
219+
- "3.13"
216220
steps:
217221
- uses: actions/checkout@v4
218222
- uses: actions/setup-python@v5
@@ -265,6 +269,7 @@ jobs:
265269
- "3.10"
266270
- "3.11"
267271
- "3.12"
272+
- "3.13"
268273
steps:
269274
- uses: actions/checkout@v4
270275
- uses: actions/setup-python@v5
@@ -293,6 +298,7 @@ jobs:
293298
- "3.10"
294299
- "3.11"
295300
- "3.12"
301+
- "3.13"
296302
steps:
297303
- uses: actions/checkout@v4
298304
- uses: actions/setup-python@v5
@@ -320,6 +326,7 @@ jobs:
320326
- "3.10"
321327
- "3.11"
322328
- "3.12"
329+
- "3.13"
323330
steps:
324331
- uses: actions/checkout@v4
325332
- uses: actions/setup-python@v5

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ integ-test:
1717
LAMBDA_BUILDERS_DEV=1 pytest tests/integration
1818

1919
lint:
20-
# Liner performs static analysis to catch latent bugs
21-
ruff aws_lambda_builders
20+
# Linter performs static analysis to catch latent bugs
21+
ruff check aws_lambda_builders
2222

2323
lint-fix:
2424
ruff aws_lambda_builders --fix
@@ -35,4 +35,4 @@ black-check:
3535
# Verifications to run before sending a pull request
3636
pr: init dev black-check
3737

38-
format: lint-fix black
38+
format: lint-fix black

aws_lambda_builders/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
# Changing version will trigger a new release!
66
# Please make the version change as the last step of your development.
77

8-
__version__ = "1.50.0"
8+
__version__ = "1.51.0"
99
RPC_PROTOCOL_VERSION = "0.3"

aws_lambda_builders/validator.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"python3.10": [ARM64, X86_64],
1919
"python3.11": [ARM64, X86_64],
2020
"python3.12": [ARM64, X86_64],
21+
"python3.13": [ARM64, X86_64],
2122
"ruby3.2": [ARM64, X86_64],
2223
"ruby3.3": [ARM64, X86_64],
2324
"java8": [ARM64, X86_64],

aws_lambda_builders/workflows/nodejs_npm/actions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def execute(self):
108108
:raises lambda_builders.actions.ActionFailedError: when NPM execution fails
109109
"""
110110
try:
111-
LOG.debug("NODEJS installing in: %s", self.install_dir)
111+
LOG.debug("NODEJS installing production dependencies in: %s", self.install_dir)
112112

113113
command = ["install", "-q", "--no-audit", "--no-save", "--unsafe-perm", "--production"]
114114
self.subprocess_npm.run(command, cwd=self.install_dir)
@@ -132,7 +132,7 @@ def execute(self):
132132
:raises lambda_builders.actions.ActionFailedError: when NPM execution fails
133133
"""
134134
try:
135-
LOG.debug("NODEJS updating in: %s", self.install_dir)
135+
LOG.debug("NODEJS updating production dependencies in: %s", self.install_dir)
136136

137137
command = [
138138
"update",

aws_lambda_builders/workflows/nodejs_npm/workflow.py

+5
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ def get_install_action(
243243
if build_options and isinstance(build_options, dict):
244244
npm_ci_option = build_options.get("use_npm_ci", False)
245245

246+
LOG.debug(
247+
"npm installation actions install only production dependencies. "
248+
"Dev dependencies are omitted from the Lambda artifacts package"
249+
)
250+
246251
if (osutils.file_exists(lockfile_path) or osutils.file_exists(shrinkwrap_path)) and npm_ci_option:
247252
return NodejsNpmCIAction(
248253
install_dir=install_dir, subprocess_npm=subprocess_npm, install_links=is_building_in_source

aws_lambda_builders/workflows/python_pip/DESIGN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def build_dependencies(artifacts_dir_path,
4949
5050
:type runtime: str
5151
:param runtime: Python version to build dependencies for. This can
52-
either be python3.8, python3.9, python3.10, python3.11 or python3.12. These are
52+
either be python3.8, python3.9, python3.10, python3.11, python3.12 or python3.13. These are
5353
currently the only supported values.
5454
5555
:type ui: :class:`lambda_builders.actions.python_pip.utils.UI`

aws_lambda_builders/workflows/python_pip/packager.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def get_lambda_abi(runtime):
8686
"python3.10": "cp310",
8787
"python3.11": "cp311",
8888
"python3.12": "cp312",
89+
"python3.13": "cp313",
8990
}
9091

9192
if runtime not in supported:
@@ -100,7 +101,7 @@ def __init__(self, runtime, python_exe, osutils=None, dependency_builder=None, a
100101
101102
:type runtime: str
102103
:param runtime: Python version to build dependencies for. This can
103-
either be python3.8, python3.9, python3.10, python3.11 or python3.12. These are currently the
104+
either be python3.8, python3.9, python3.10, python3.11, python3.12 or python3.13. These are currently the
104105
only supported values.
105106
106107
:type osutils: :class:`lambda_builders.utils.OSUtils`

pyproject.toml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
[tool.ruff]
22
line-length = 120
33

4+
[tool.ruff.lint]
5+
46
select = [
5-
"E", # Pycodestyle
6-
"F", # Pyflakes
7-
"PL", # pylint
8-
"I", # isort
7+
"E", # Pycodestyle
8+
"F", # Pyflakes
9+
"PL", # pylint
10+
"I", # isort
911
]
1012
ignore = ["PLR0913"]
1113

12-
[tool.ruff.pylint]
14+
[tool.ruff.lint.pylint]
1315
max-branches = 13
1416

15-
[tool.ruff.per-file-ignores]
17+
[tool.ruff.lint.per-file-ignores]
1618
"__init__.py" = ["F401", "E501"]
1719
"aws_lambda_builders/workflow.py" = ["E501"]
1820

@@ -32,4 +34,4 @@ exclude = '''
3234
| pip-wheel-metadata
3335
)/
3436
)
35-
'''
37+
'''

requirements/dev.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
coverage==7.5.1
1+
coverage==7.6.4; python_version>="3.9"
2+
coverage==7.6.1; python_version<"3.9"
23
flake8==3.8.4
34
pytest-cov==5.0.0
45

@@ -8,5 +9,6 @@ parameterized==0.9.0
89
pyelftools~=0.31 # Used to verify the generated Go binary architecture in integration tests (utils.py)
910

1011
# formatter
11-
black==24.4.2
12-
ruff==0.4.3
12+
black==24.10.0; python_version>="3.9"
13+
black==24.8.0; python_version<"3.9"
14+
ruff==0.7.1

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def read_version():
6363
"Programming Language :: Python :: 3.10",
6464
"Programming Language :: Python :: 3.11",
6565
"Programming Language :: Python :: 3.12",
66+
"Programming Language :: Python :: 3.13",
6667
"Topic :: Internet",
6768
"Topic :: Software Development :: Build Tools",
6869
"Topic :: Utilities",

tests/integration/workflows/java_gradle/test_java_gradle.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import shutil
33
import tempfile
4+
import platform
45

56
from unittest import TestCase
67
from pathlib import Path
@@ -36,7 +37,18 @@ class TestJavaGradle(TestCase):
3637

3738
def setUp(self):
3839
self.artifacts_dir = tempfile.mkdtemp()
39-
self.scratch_dir = tempfile.mkdtemp()
40+
41+
scratch_folder_override = None
42+
if platform.system().lower() == "windows" and os.getenv("GITHUB_ACTIONS"):
43+
# lucashuy: there is some really odd behaviour where
44+
# gradle will refuse to work it is run within
45+
# the default TEMP folder location in Github Actions
46+
#
47+
# use the runner's home directory as a workaround
48+
scratch_folder_override = os.getenv("userprofile")
49+
50+
self.scratch_dir = tempfile.mkdtemp(dir=scratch_folder_override)
51+
4052
self.dependencies_dir = tempfile.mkdtemp()
4153
self.builder = LambdaBuilder(language="java", dependency_manager="gradle", application_framework=None)
4254

tests/integration/workflows/python_pip/test_python_pip.py

+15-12
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
logger = logging.getLogger("aws_lambda_builders.workflows.python_pip.workflow")
1919
IS_WINDOWS = platform.system().lower() == "windows"
2020
NOT_ARM = platform.processor() != "aarch64"
21-
ARM_RUNTIMES = {"python3.8", "python3.9", "python3.10", "python3.11", "python3.12"}
21+
ARM_RUNTIMES = {"python3.8", "python3.9", "python3.10", "python3.11", "python3.12", "python3.13"}
2222

2323

2424
@parameterized_class(("experimental_flags",), [([]), ([EXPERIMENTAL_FLAG_BUILD_PERFORMANCE])])
@@ -64,6 +64,7 @@ def setUp(self):
6464
"python3.10": "python3.9",
6565
"python3.11": "python3.10",
6666
"python3.12": "python3.11",
67+
"python3.13": "python3.12",
6768
}
6869

6970
def tearDown(self):
@@ -96,9 +97,9 @@ def test_must_build_python_project(self):
9697
experimental_flags=self.experimental_flags,
9798
)
9899

99-
if self.runtime in ("python3.12"):
100-
self.check_architecture_in("numpy-1.26.1.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"])
101-
expected_files = self.test_data_files.union({"numpy", "numpy-1.26.1.dist-info", "numpy.libs"})
100+
if self.runtime in ("python3.12", "python3.13"):
101+
self.check_architecture_in("numpy-2.1.2.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"])
102+
expected_files = self.test_data_files.union({"numpy", "numpy-2.1.2.dist-info", "numpy.libs"})
102103
elif self.runtime in ("python3.10", "python3.11"):
103104
self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"])
104105
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):
126127
executable_search_paths=[executable_dir],
127128
)
128129

129-
if self.runtime in ("python3.12"):
130-
self.check_architecture_in("numpy-1.26.1.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"])
131-
expected_files = self.test_data_files.union({"numpy", "numpy-1.26.1.dist-info", "numpy.libs"})
132-
elif self.runtime in ("python3.10", "python3.11", "python3.12"):
130+
if self.runtime in ("python3.12", "python3.13"):
131+
self.check_architecture_in("numpy-2.1.2.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"])
132+
expected_files = self.test_data_files.union({"numpy", "numpy-2.1.2.dist-info", "numpy.libs"})
133+
elif self.runtime in ("python3.10", "python3.11"):
133134
self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"])
134135
expected_files = self.test_data_files.union({"numpy", "numpy-1.23.5.dist-info", "numpy.libs"})
135136
else:
@@ -174,15 +175,15 @@ def test_must_build_python_project_with_arm_architecture(self):
174175
experimental_flags=self.experimental_flags,
175176
)
176177
expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.20.3.dist-info"})
177-
if self.runtime in ("python3.12"):
178-
expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.26.1.dist-info"})
178+
if self.runtime in ("python3.12", "python3.13"):
179+
expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-2.1.2.dist-info"})
179180
if self.runtime in ("python3.10", "python3.11"):
180181
expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.23.5.dist-info"})
181182
output_files = set(os.listdir(self.artifacts_dir))
182183
self.assertEqual(expected_files, output_files)
183184

184-
if self.runtime in ("python3.12"):
185-
self.check_architecture_in("numpy-1.26.1.dist-info", ["manylinux2014_aarch64"])
185+
if self.runtime in ("python3.12", "python3.13"):
186+
self.check_architecture_in("numpy-2.1.2.dist-info", ["manylinux2014_aarch64"])
186187
elif self.runtime in ("python3.10", "python3.11"):
187188
self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_aarch64"])
188189
else:
@@ -247,6 +248,8 @@ def test_must_resolve_local_dependency(self):
247248
self.assertIn(f, output_files)
248249

249250
def test_must_resolve_unknown_package_name(self):
251+
if IS_WINDOWS and self.runtime == "python3.13":
252+
self.skipTest("Skip test as pip install inflate64 does not work on Windows with Python 3.13")
250253
self.builder.build(
251254
self.source_dir,
252255
self.artifacts_dir,

tests/integration/workflows/python_pip/testdata/requirements-numpy.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ numpy==1.20.3; python_version == '3.8'
22
numpy==1.20.3; python_version == '3.9'
33
numpy==1.23.5; python_version == '3.10'
44
numpy==1.23.5; python_version == '3.11'
5-
numpy==1.26.1; python_version == '3.12'
5+
numpy==2.1.2; python_version == '3.12'
6+
numpy==2.1.2; python_version == '3.13'

tests/unit/workflows/python_pip/test_packager.py

+3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ def test_get_lambda_abi_python311(self):
106106
def test_get_lambda_abi_python312(self):
107107
assert "cp312" == get_lambda_abi("python3.12")
108108

109+
def test_get_lambda_abi_python313(self):
110+
assert "cp313" == get_lambda_abi("python3.13")
111+
109112

110113
class TestPythonPipDependencyBuilder(object):
111114
def test_can_call_dependency_builder(self, osutils):

0 commit comments

Comments
 (0)