12
12
13
13
logger = logging .getLogger ("aws_lambda_builders.workflows.python_pip.workflow" )
14
14
IS_WINDOWS = platform .system ().lower () == "windows"
15
+ NOT_ARM = platform .processor () != "aarch64"
16
+ ARM_RUNTIMES = {"python3.8" , "python3.9" }
15
17
16
18
17
19
class TestPythonPipWorkflow (TestCase ):
@@ -29,12 +31,14 @@ def setUp(self):
29
31
30
32
self .manifest_path_valid = os .path .join (self .TEST_DATA_FOLDER , "requirements-numpy.txt" )
31
33
self .manifest_path_invalid = os .path .join (self .TEST_DATA_FOLDER , "requirements-invalid.txt" )
34
+ self .manifest_path_sdist = os .path .join (self .TEST_DATA_FOLDER , "requirements-wrapt.txt" )
32
35
33
36
self .test_data_files = {
34
37
"__init__.py" ,
35
38
"main.py" ,
36
39
"requirements-invalid.txt" ,
37
40
"requirements-numpy.txt" ,
41
+ "requirements-wrapt.txt" ,
38
42
"local-dependencies" ,
39
43
}
40
44
@@ -84,8 +88,27 @@ def test_must_build_python_project(self):
84
88
output_files = set (os .listdir (self .artifacts_dir ))
85
89
self .assertEqual (expected_files , output_files )
86
90
91
+ @skipIf (NOT_ARM , "Skip if not running on ARM64" )
92
+ def test_must_build_python_project_from_sdist_with_arm (self ):
93
+ if self .runtime not in ARM_RUNTIMES :
94
+ self .skipTest ("{} is not supported on ARM architecture" .format (self .runtime ))
95
+
96
+ self .builder .build (
97
+ self .source_dir ,
98
+ self .artifacts_dir ,
99
+ self .scratch_dir ,
100
+ self .manifest_path_sdist ,
101
+ runtime = self .runtime ,
102
+ architecture = "arm64" ,
103
+ )
104
+ expected_files = self .test_data_files .union ({"wrapt" , "wrapt-1.13.3.dist-info" })
105
+ output_files = set (os .listdir (self .artifacts_dir ))
106
+ self .assertEqual (expected_files , output_files )
107
+
108
+ self .check_architecture_in ("wrapt-1.13.3.dist-info" , ["linux_aarch64" ])
109
+
87
110
def test_must_build_python_project_with_arm_architecture (self ):
88
- if self .runtime != "python3.8" :
111
+ if self .runtime not in ARM_RUNTIMES :
89
112
self .skipTest ("{} is not supported on ARM architecture" .format (self .runtime ))
90
113
### Check the wheels
91
114
self .builder .build (
0 commit comments