@@ -11,11 +11,15 @@ def test_torch_cuda_source_covers_windows_and_linux() -> None:
1111
1212 torch_sources = data ["tool" ]["uv" ]["sources" ]["torch" ]
1313 cu128_sources = [source for source in torch_sources if source .get ("index" ) == "pytorch-cu128" ]
14+ cu130_sources = [source for source in torch_sources if source .get ("index" ) == "r2-cu130" ]
1415
15- assert len (cu128_sources ) == 1
16- marker = cu128_sources [0 ]["marker" ]
17- assert "sys_platform=='linux'" in marker
18- assert "sys_platform=='win32'" in marker
16+ assert {source ["marker" ] for source in cu128_sources } == {
17+ "sys_platform=='linux' and platform_machine=='x86_64'" ,
18+ "sys_platform=='win32'" ,
19+ }
20+ assert [source ["marker" ] for source in cu130_sources ] == [
21+ "sys_platform=='linux' and platform_machine=='aarch64'"
22+ ]
1923
2024
2125def test_windows_lock_uses_cuda_torch () -> None :
@@ -29,7 +33,13 @@ def test_windows_lock_uses_cuda_torch() -> None:
2933 "name" : "torch" ,
3034 "version" : "2.7.0+cu128" ,
3135 "source" : {"registry" : "https://download.pytorch.org/whl/cu128" },
32- "marker" : "sys_platform == 'linux' or sys_platform == 'win32'" ,
36+ "marker" : "(platform_machine == 'x86_64' and sys_platform == 'linux') or sys_platform == 'win32'" ,
37+ } in torch_dependencies
38+ assert {
39+ "name" : "torch" ,
40+ "version" : "2.9.0+cu130" ,
41+ "source" : {"registry" : "https://download-r2.pytorch.org/whl/cu130" },
42+ "marker" : "platform_machine == 'aarch64' and sys_platform == 'linux'" ,
3343 } in torch_dependencies
3444
3545 torch_packages = [package for package in lock ["package" ] if package ["name" ] == "torch" ]
0 commit comments