Skip to content

Commit c2f1ce2

Browse files
authored
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
1 parent eedc026 commit c2f1ce2

File tree

8 files changed

+32
-15
lines changed

8 files changed

+32
-15
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

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/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`

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/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)