1818 download_wheel_from_s3 ,
1919)
2020
21- SAMPLE_WHEELS = [
22- "ray-1.0.0-cp39-cp39 -manylinux2014_x86_64" ,
23- "ray-1.0.0-cp39-cp39 -manylinux2014_aarch64" ,
24- "ray-1.0.0-cp39-cp39 -macosx_12_0_arm64" ,
25- "ray-1.0.0-cp39-cp39 -win_amd64" ,
21+ _SAMPLE_WHEELS = [
22+ "ray-1.0.0-cp312-cp312 -manylinux2014_x86_64" ,
23+ "ray-1.0.0-cp312-cp312 -manylinux2014_aarch64" ,
24+ "ray-1.0.0-cp312-cp312 -macosx_12_0_arm64" ,
25+ "ray-1.0.0-cp312-cp312 -win_amd64" ,
2626]
2727
2828
@@ -55,10 +55,10 @@ def test_get_wheel_names():
5555def test_check_downloaded_wheels ():
5656 with tempfile .TemporaryDirectory () as tmp_dir :
5757 wheels = [
58- "ray-1.0.0-cp39-cp39 -manylinux2014_x86_64" ,
59- "ray-1.0.0-cp39-cp39 -manylinux2014_aarch64" ,
60- "ray-1.0.0-cp39-cp39 -macosx_12_0_arm64" ,
61- "ray-1.0.0-cp39-cp39 -win_amd64" ,
58+ "ray-1.0.0-cp312-cp312 -manylinux2014_x86_64" ,
59+ "ray-1.0.0-cp312-cp312 -manylinux2014_aarch64" ,
60+ "ray-1.0.0-cp312-cp312 -macosx_12_0_arm64" ,
61+ "ray-1.0.0-cp312-cp312 -win_amd64" ,
6262 ]
6363
6464 for wheel in wheels :
@@ -71,10 +71,10 @@ def test_check_downloaded_wheels():
7171def test_check_downloaded_wheels_fail ():
7272 with tempfile .TemporaryDirectory () as tmp_dir :
7373 wheels = [
74- "ray-1.0.0-cp39-cp39 -manylinux2014_x86_64" ,
75- "ray-1.0.0-cp39-cp39 -manylinux2014_aarch64" ,
76- "ray-1.0.0-cp39-cp39 -macosx_12_0_arm64" ,
77- "ray-1.0.0-cp39-cp39 -win_amd64" ,
74+ "ray-1.0.0-cp312-cp312 -manylinux2014_x86_64" ,
75+ "ray-1.0.0-cp312-cp312 -manylinux2014_aarch64" ,
76+ "ray-1.0.0-cp312-cp312 -macosx_12_0_arm64" ,
77+ "ray-1.0.0-cp312-cp312 -win_amd64" ,
7878 ]
7979
8080 for wheel in wheels [:3 ]:
@@ -89,10 +89,10 @@ def test_check_downloaded_wheels_fail():
8989def test_download_wheel_from_s3 (mock_boto3_client ):
9090 with tempfile .TemporaryDirectory () as tmp_dir :
9191 keys = [
92- "releases/1.0.0/1234567/ray-1.0.0-cp39-cp39 -manylinux2014_x86_64.whl" ,
93- "releases/1.0.0/1234567/ray-1.0.0-cp39-cp39 -manylinux2014_aarch64.whl" ,
94- "releases/1.0.0/1234567/ray-1.0.0-cp39-cp39 -macosx_12_0_arm64.whl" ,
95- "releases/1.0.0/1234567/ray-1.0.0-cp39-cp39 -win_amd64.whl" ,
92+ "releases/1.0.0/1234567/ray-1.0.0-cp312-cp312 -manylinux2014_x86_64.whl" ,
93+ "releases/1.0.0/1234567/ray-1.0.0-cp312-cp312 -manylinux2014_aarch64.whl" ,
94+ "releases/1.0.0/1234567/ray-1.0.0-cp312-cp312 -macosx_12_0_arm64.whl" ,
95+ "releases/1.0.0/1234567/ray-1.0.0-cp312-cp312 -win_amd64.whl" ,
9696 ]
9797 for key in keys :
9898 download_wheel_from_s3 (key = key , directory_path = tmp_dir )
@@ -115,8 +115,8 @@ def test_download_wheel_from_s3_fail(mock_boto3_client):
115115
116116 with tempfile .TemporaryDirectory () as tmp_dir :
117117 keys = [
118- "releases/1.0.0/1234567/ray-1.0.0-cp39-cp39 -manylinux2014_x86_64.whl" ,
119- "releases/1.0.0/1234567/ray-1.0.0-cp39-cp39 -manylinux2014_aarch64.whl" ,
118+ "releases/1.0.0/1234567/ray-1.0.0-cp312-cp312 -manylinux2014_x86_64.whl" ,
119+ "releases/1.0.0/1234567/ray-1.0.0-cp312-cp312 -manylinux2014_aarch64.whl" ,
120120 ]
121121 for key in keys :
122122 with pytest .raises (ClientError , match = "Not Found" ):
@@ -132,7 +132,7 @@ def test_download_ray_wheels_from_s3(
132132 commit_hash = "1234567"
133133 ray_version = "1.0.0"
134134
135- mock_get_wheel_names .return_value = SAMPLE_WHEELS
135+ mock_get_wheel_names .return_value = _SAMPLE_WHEELS
136136
137137 with tempfile .TemporaryDirectory () as tmp_dir :
138138 download_ray_wheels_from_s3 (
@@ -142,15 +142,15 @@ def test_download_ray_wheels_from_s3(
142142 )
143143
144144 mock_get_wheel_names .assert_called_with (ray_version = ray_version )
145- assert mock_download_wheel .call_count == len (SAMPLE_WHEELS )
145+ assert mock_download_wheel .call_count == len (_SAMPLE_WHEELS )
146146 for i , call_args in enumerate (mock_download_wheel .call_args_list ):
147147 assert (
148148 call_args [0 ][0 ]
149- == f"releases/{ ray_version } /{ commit_hash } /{ SAMPLE_WHEELS [i ]} .whl"
149+ == f"releases/{ ray_version } /{ commit_hash } /{ _SAMPLE_WHEELS [i ]} .whl"
150150 )
151151 assert call_args [0 ][1 ] == tmp_dir
152152
153- mock_check_wheels .assert_called_with (tmp_dir , SAMPLE_WHEELS )
153+ mock_check_wheels .assert_called_with (tmp_dir , _SAMPLE_WHEELS )
154154
155155
156156@mock .patch ("ci.ray_ci.automation.ray_wheels_lib.download_wheel_from_s3" )
@@ -162,7 +162,7 @@ def test_download_ray_wheels_from_s3_with_branch(
162162 commit_hash = "1234567"
163163 ray_version = "1.0.0"
164164
165- mock_get_wheel_names .return_value = SAMPLE_WHEELS
165+ mock_get_wheel_names .return_value = _SAMPLE_WHEELS
166166
167167 with tempfile .TemporaryDirectory () as tmp_dir :
168168 download_ray_wheels_from_s3 (
@@ -173,14 +173,15 @@ def test_download_ray_wheels_from_s3_with_branch(
173173 )
174174
175175 mock_get_wheel_names .assert_called_with (ray_version = ray_version )
176- assert mock_download_wheel .call_count == len (SAMPLE_WHEELS )
176+ assert mock_download_wheel .call_count == len (_SAMPLE_WHEELS )
177177 for i , call_args in enumerate (mock_download_wheel .call_args_list ):
178178 assert (
179- call_args [0 ][0 ] == f"custom_branch/{ commit_hash } /{ SAMPLE_WHEELS [i ]} .whl"
179+ call_args [0 ][0 ]
180+ == f"custom_branch/{ commit_hash } /{ _SAMPLE_WHEELS [i ]} .whl"
180181 )
181182 assert call_args [0 ][1 ] == tmp_dir
182183
183- mock_check_wheels .assert_called_with (tmp_dir , SAMPLE_WHEELS )
184+ mock_check_wheels .assert_called_with (tmp_dir , _SAMPLE_WHEELS )
184185
185186
186187@mock .patch ("ci.ray_ci.automation.ray_wheels_lib.download_wheel_from_s3" )
@@ -192,7 +193,7 @@ def test_download_ray_wheels_from_s3_partial_platform(
192193 commit_hash = "1234567"
193194 ray_version = "1.1.0"
194195
195- mock_get_wheel_names .return_value = SAMPLE_WHEELS
196+ mock_get_wheel_names .return_value = _SAMPLE_WHEELS
196197
197198 with tempfile .TemporaryDirectory () as tmp_dir :
198199 download_ray_wheels_from_s3 (
@@ -202,15 +203,15 @@ def test_download_ray_wheels_from_s3_partial_platform(
202203 )
203204
204205 mock_get_wheel_names .assert_called_with (ray_version = ray_version )
205- assert mock_download_wheel .call_count == len (SAMPLE_WHEELS )
206+ assert mock_download_wheel .call_count == len (_SAMPLE_WHEELS )
206207 for i , call_args in enumerate (mock_download_wheel .call_args_list ):
207208 assert (
208209 call_args [0 ][0 ]
209- == f"releases/{ ray_version } /{ commit_hash } /{ SAMPLE_WHEELS [i ]} .whl"
210+ == f"releases/{ ray_version } /{ commit_hash } /{ _SAMPLE_WHEELS [i ]} .whl"
210211 )
211212 assert call_args [0 ][1 ] == tmp_dir
212213
213- mock_check_wheels .assert_called_with (tmp_dir , SAMPLE_WHEELS )
214+ mock_check_wheels .assert_called_with (tmp_dir , _SAMPLE_WHEELS )
214215
215216
216217@mock .patch ("ci.ray_ci.automation.ray_wheels_lib.download_wheel_from_s3" )
@@ -222,15 +223,15 @@ def test_download_ray_wheels_from_s3_fail_check_wheels(
222223 commit_hash = "1234567"
223224 ray_version = "1.0.0"
224225
225- mock_get_wheel_names .return_value = SAMPLE_WHEELS
226+ mock_get_wheel_names .return_value = _SAMPLE_WHEELS
226227 mock_check_wheels .side_effect = AssertionError ()
227228
228229 with tempfile .TemporaryDirectory () as tmp_dir :
229230 with pytest .raises (AssertionError ):
230231 download_ray_wheels_from_s3 (
231232 commit_hash = commit_hash , ray_version = ray_version , directory_path = tmp_dir
232233 )
233- assert mock_download_wheel .call_count == len (SAMPLE_WHEELS )
234+ assert mock_download_wheel .call_count == len (_SAMPLE_WHEELS )
234235
235236
236237@mock .patch ("ci.ray_ci.automation.ray_wheels_lib.download_wheel_from_s3" )
@@ -242,7 +243,7 @@ def test_download_ray_wheels_from_s3_fail_download(
242243 commit_hash = "1234567"
243244 ray_version = "1.0.0"
244245
245- mock_get_wheel_names .return_value = SAMPLE_WHEELS
246+ mock_get_wheel_names .return_value = _SAMPLE_WHEELS
246247 mock_download_wheel .side_effect = ClientError (
247248 {
248249 "Error" : {
@@ -263,31 +264,31 @@ def test_download_ray_wheels_from_s3_fail_download(
263264
264265def test_add_build_tag_to_wheel ():
265266 with tempfile .TemporaryDirectory () as tmp_dir :
266- wheel_name = "ray-1.0.0-cp39-cp39 -manylinux2014_x86_64.whl"
267+ wheel_name = "ray-1.0.0-cp312-cp312 -manylinux2014_x86_64.whl"
267268 wheel_path = os .path .join (tmp_dir , wheel_name )
268269 with open (wheel_path , "w" ) as f :
269270 f .write ("" )
270271 add_build_tag_to_wheel (wheel_path = wheel_path , build_tag = "123" )
271- expected_wheel_name = "ray-1.0.0-123-cp39-cp39 -manylinux2014_x86_64.whl"
272+ expected_wheel_name = "ray-1.0.0-123-cp312-cp312 -manylinux2014_x86_64.whl"
272273 expected_wheel_path = os .path .join (tmp_dir , expected_wheel_name )
273274 assert os .path .exists (expected_wheel_path )
274275
275276
276277def test_add_build_tag_to_wheels ():
277278 with tempfile .TemporaryDirectory () as tmp_dir :
278279 wheels = [
279- "ray-1.0.0-cp39-cp39 -manylinux2014_x86_64.whl" ,
280- "ray-1.0.0-cp39-cp39 -manylinux2014_aarch64.whl" ,
280+ "ray-1.0.0-cp312-cp312 -manylinux2014_x86_64.whl" ,
281+ "ray-1.0.0-cp312-cp312 -manylinux2014_aarch64.whl" ,
281282 ]
282283 for wheel in wheels :
283284 with open (os .path .join (tmp_dir , wheel ), "w" ) as f :
284285 f .write ("" )
285286 add_build_tag_to_wheels (directory_path = tmp_dir , build_tag = "123" )
286287 assert os .path .exists (
287- os .path .join (tmp_dir , "ray-1.0.0-123-cp39-cp39 -manylinux2014_x86_64.whl" )
288+ os .path .join (tmp_dir , "ray-1.0.0-123-cp312-cp312 -manylinux2014_x86_64.whl" )
288289 )
289290 assert os .path .exists (
290- os .path .join (tmp_dir , "ray-1.0.0-123-cp39-cp39 -manylinux2014_aarch64.whl" )
291+ os .path .join (tmp_dir , "ray-1.0.0-123-cp312-cp312 -manylinux2014_aarch64.whl" )
291292 )
292293
293294
0 commit comments