99from ci .tools .bindings_config import main , parse_config , resolve_release_bindings_package , write_github_env
1010
1111
12- def _source (root , * , old = False , schema2 = False ):
13- current_root = "cuda_bindings" if old else "cuda_bindings_13"
12+ def _source (root ):
1413 packages = {
1514 "cuda_bindings_12" : {"toolkit_version" : "12.9.1" , "release_status" : "maintenance" },
16- current_root : {"toolkit_version" : "13.4.2" , "release_status" : "current" },
15+ "cuda_bindings_13" : {"toolkit_version" : "13.4.2" , "release_status" : "current" },
16+ }
17+ raw = {
18+ "schema_version" : 2 ,
19+ "python" : {"supported" : ["3.11" , "3.14t" ]},
20+ "cuda" : {"bindings" : {"package_roots" : packages }},
1721 }
18- raw = {"cuda" : {"build" : {"version" : "13.4.2" }, "prev_build" : {"version" : "12.9.1" }}}
19- if not old :
20- raw ["python" ] = {"supported" : ["3.11" , "3.14t" ]}
21- if schema2 :
22- raw ["schema_version" ] = 2
23- raw ["cuda" ] = {"bindings" : {"package_roots" : packages }}
2422 config = root / "ci" / "versions.yml"
2523 config .parent .mkdir (parents = True )
2624 config .write_text (yaml .safe_dump (raw ))
27- (root / current_root ).mkdir ()
28- if not old :
29- (root / "cuda_bindings_12" ).mkdir ()
25+ for package_root in packages :
26+ (root / package_root ).mkdir ()
3027 return root , raw
3128
3229
3330@pytest .mark .parametrize (
34- ("old" , "schema2" , " tag" , "expected_root" , "legacy_artifact " ),
31+ ("tag" , "expected_root" ),
3532 [
36- (True , False , "v13.4.4" , "cuda_bindings" , True ),
37- (False , False , "v12.9.11" , "cuda_bindings_12" , False ),
38- (False , True , "v12.9.11" , "cuda_bindings_12" , False ),
39- (False , True , "v13.4.9" , "cuda_bindings_13" , False ),
33+ ("v12.9.11" , "cuda_bindings_12" ),
34+ ("v13.4.9" , "cuda_bindings_13" ),
4035 ],
4136)
4237@pytest .mark .agent_authored (model = "gpt-6" )
43- def test_tagged_source_compatibility (tmp_path , old , schema2 , tag , expected_root , legacy_artifact ):
44- source , _ = _source (tmp_path , old = old , schema2 = schema2 )
38+ def test_tagged_source_routes_both_bindings_majors (tmp_path , tag , expected_root ):
39+ source , _ = _source (tmp_path )
4540 record = resolve_release_bindings_package (tag , source )
4641 assert record ["package_root" ] == expected_root
4742 assert record ["release_version" ] == tag .removeprefix ("v" )
48- assert record .get ("allow_legacy_python_artifact" , False ) is legacy_artifact
49-
50-
51- @pytest .mark .agent_authored (model = "gpt-6" )
52- def test_old_cuda13_source_cannot_resolve_cuda12 (tmp_path ):
53- source , _ = _source (tmp_path , old = True )
54- with pytest .raises (ValueError , match = "no bindings root" ):
55- resolve_release_bindings_package ("v12.9.11" , source )
5643
5744
5845@pytest .mark .agent_authored (model = "gpt-6" )
5946def test_release_cli_uses_tagged_source_without_control_fallback (tmp_path , capsys ):
60- source , _ = _source (tmp_path / "tagged" , old = True )
47+ source , _ = _source (tmp_path / "tagged" )
6148 assert (
6249 main (
6350 [
@@ -72,10 +59,9 @@ def test_release_cli_uses_tagged_source_without_control_fallback(tmp_path, capsy
7259 == 0
7360 )
7461 assert json .loads (capsys .readouterr ().out ) == {
75- "package_root" : "cuda_bindings " ,
62+ "package_root" : "cuda_bindings_13 " ,
7663 "toolkit_version" : "13.4.2" ,
7764 "release_version" : "13.4.4" ,
78- "allow_legacy_python_artifact" : True ,
7965 }
8066 empty = tmp_path / "absent-source"
8167 empty .mkdir ()
@@ -94,7 +80,7 @@ def test_release_cli_uses_tagged_source_without_control_fallback(tmp_path, capsy
9480
9581@pytest .mark .agent_authored (model = "gpt-6" )
9682def test_dependent_release_uses_current_tagged_bindings (tmp_path ):
97- source , _ = _source (tmp_path , schema2 = True )
83+ source , _ = _source (tmp_path )
9884 assert resolve_release_bindings_package ("cuda-core-v1.2.0" , source ) == {
9985 "package_root" : "cuda_bindings_13" ,
10086 "toolkit_version" : "13.4.2" ,
@@ -104,7 +90,7 @@ def test_dependent_release_uses_current_tagged_bindings(tmp_path):
10490@pytest .mark .parametrize ("conflict" , ["roles" , "majors" ])
10591@pytest .mark .agent_authored (model = "gpt-6" )
10692def test_schema2_rejects_ambiguous_release_routing (tmp_path , conflict ):
107- _ , raw = _source (tmp_path , schema2 = True )
93+ _ , raw = _source (tmp_path )
10894 maintenance = raw ["cuda" ]["bindings" ]["package_roots" ]["cuda_bindings_12" ]
10995 maintenance ["release_status" if conflict == "roles" else "toolkit_version" ] = (
11096 "current" if conflict == "roles" else "13.4.1"
0 commit comments