|
18 | 18 | logger = logging.getLogger("aws_lambda_builders.workflows.python_pip.workflow") |
19 | 19 | IS_WINDOWS = platform.system().lower() == "windows" |
20 | 20 | NOT_ARM = platform.processor() != "aarch64" |
21 | | -ARM_RUNTIMES = {"python3.8", "python3.9"} |
| 21 | +ARM_RUNTIMES = {"python3.8", "python3.9", "python3.10"} |
22 | 22 |
|
23 | 23 |
|
24 | 24 | @parameterized_class(("experimental_flags",), [([]), ([EXPERIMENTAL_FLAG_BUILD_PERFORMANCE])]) |
@@ -60,6 +60,7 @@ def setUp(self): |
60 | 60 | "python3.7": "python3.8", |
61 | 61 | "python3.8": "python3.9", |
62 | 62 | "python3.9": "python3.7", |
| 63 | + "python3.10": "python3.9", |
63 | 64 | } |
64 | 65 |
|
65 | 66 | def tearDown(self): |
@@ -92,33 +93,43 @@ def test_must_build_python_project(self): |
92 | 93 | experimental_flags=self.experimental_flags, |
93 | 94 | ) |
94 | 95 |
|
95 | | - self.check_architecture_in("numpy-1.20.3.dist-info", ["manylinux2010_x86_64", "manylinux1_x86_64"]) |
96 | | - expected_files = self.test_data_files.union({"numpy", "numpy-1.20.3.dist-info", "numpy.libs"}) |
| 96 | + if self.runtime == "python3.10": |
| 97 | + self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"]) |
| 98 | + expected_files = self.test_data_files.union({"numpy", "numpy-1.23.5.dist-info", "numpy.libs"}) |
| 99 | + else: |
| 100 | + self.check_architecture_in("numpy-1.20.3.dist-info", ["manylinux2010_x86_64", "manylinux1_x86_64"]) |
| 101 | + expected_files = self.test_data_files.union({"numpy", "numpy-1.20.3.dist-info", "numpy.libs"}) |
97 | 102 |
|
98 | 103 | output_files = set(os.listdir(self.artifacts_dir)) |
99 | 104 | self.assertEqual(expected_files, output_files) |
100 | 105 |
|
101 | 106 | def test_must_build_python_project_python3_binary(self): |
102 | 107 | python_paths = which("python") |
103 | | - executable_dir = pathlib.Path(tempfile.gettempdir()) |
104 | | - new_python_path = executable_dir.joinpath("python3") |
105 | | - os.symlink(python_paths[0], new_python_path) |
106 | | - # Build with access to the newly symlinked python3 binary. |
107 | | - self.builder.build( |
108 | | - self.source_dir, |
109 | | - self.artifacts_dir, |
110 | | - self.scratch_dir, |
111 | | - self.manifest_path_valid, |
112 | | - runtime=self.runtime, |
113 | | - experimental_flags=self.experimental_flags, |
114 | | - executable_search_paths=[executable_dir], |
115 | | - ) |
116 | | - self.check_architecture_in("numpy-1.20.3.dist-info", ["manylinux2010_x86_64", "manylinux1_x86_64"]) |
117 | | - expected_files = self.test_data_files.union({"numpy", "numpy-1.20.3.dist-info", "numpy.libs"}) |
| 108 | + with tempfile.TemporaryDirectory() as executable_dir_str: |
| 109 | + executable_dir = pathlib.Path(executable_dir_str) |
| 110 | + new_python_path = executable_dir.joinpath("python3") |
| 111 | + os.symlink(python_paths[0], new_python_path) |
| 112 | + # Build with access to the newly symlinked python3 binary. |
| 113 | + self.builder.build( |
| 114 | + self.source_dir, |
| 115 | + self.artifacts_dir, |
| 116 | + self.scratch_dir, |
| 117 | + self.manifest_path_valid, |
| 118 | + runtime=self.runtime, |
| 119 | + experimental_flags=self.experimental_flags, |
| 120 | + executable_search_paths=[executable_dir], |
| 121 | + ) |
118 | 122 |
|
119 | | - output_files = set(os.listdir(self.artifacts_dir)) |
120 | | - self.assertEqual(expected_files, output_files) |
121 | | - os.unlink(new_python_path) |
| 123 | + if self.runtime == "python3.10": |
| 124 | + self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"]) |
| 125 | + expected_files = self.test_data_files.union({"numpy", "numpy-1.23.5.dist-info", "numpy.libs"}) |
| 126 | + else: |
| 127 | + self.check_architecture_in("numpy-1.20.3.dist-info", ["manylinux2010_x86_64", "manylinux1_x86_64"]) |
| 128 | + expected_files = self.test_data_files.union({"numpy", "numpy-1.20.3.dist-info", "numpy.libs"}) |
| 129 | + |
| 130 | + output_files = set(os.listdir(self.artifacts_dir)) |
| 131 | + self.assertEqual(expected_files, output_files) |
| 132 | + os.unlink(new_python_path) |
122 | 133 |
|
123 | 134 | @skipIf(NOT_ARM, "Skip if not running on ARM64") |
124 | 135 | def test_must_build_python_project_from_sdist_with_arm(self): |
@@ -154,10 +165,15 @@ def test_must_build_python_project_with_arm_architecture(self): |
154 | 165 | experimental_flags=self.experimental_flags, |
155 | 166 | ) |
156 | 167 | expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.20.3.dist-info"}) |
| 168 | + if self.runtime == "python3.10": |
| 169 | + expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.23.5.dist-info"}) |
157 | 170 | output_files = set(os.listdir(self.artifacts_dir)) |
158 | 171 | self.assertEqual(expected_files, output_files) |
159 | 172 |
|
160 | | - self.check_architecture_in("numpy-1.20.3.dist-info", ["manylinux2014_aarch64"]) |
| 173 | + if self.runtime == "python3.10": |
| 174 | + self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_aarch64"]) |
| 175 | + else: |
| 176 | + self.check_architecture_in("numpy-1.20.3.dist-info", ["manylinux2014_aarch64"]) |
161 | 177 |
|
162 | 178 | def test_mismatch_runtime_python_project(self): |
163 | 179 | # NOTE : Build still works if other versions of python are accessible on the path. eg: /usr/bin/python3.7 |
|
0 commit comments