Skip to content

Commit 771078c

Browse files
rwgkclaude
andcommitted
ci: limit schema-less release routing to retained CUDA 13 tags
Tagged sources that predate the bindings registry built only CUDA 13 bindings. Their CI runs hold no toolkit-qualified CUDA 12 artifacts, and v12.9.11a0 is the only CUDA 12 tag with such a source. Resolve these sources to their CUDA 13 root alone, and let the existing toolkit match reject CUDA 12 tags instead of routing them to artifacts that cannot exist. Drop CLI argument cross-checks whose misuse already fails loudly. Co-Authored-By: Claude Fable 5.2 <[email protected]>
1 parent 1b9fd9f commit 771078c

3 files changed

Lines changed: 13 additions & 34 deletions

File tree

‎ci/tools/bindings_config.py‎

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -223,20 +223,12 @@ def resolve_release_bindings_package(
223223
raw = yaml.safe_load(config_path.read_text(encoding="utf-8"))
224224
legacy_config = "schema_version" not in raw
225225
if legacy_config:
226-
current_toolkit = raw["cuda"]["build"]["version"]
227-
if _TOOLKIT_VERSION_PATTERN.fullmatch(current_toolkit) is None or not current_toolkit.startswith("13."):
226+
# Tagged sources that predate the registry built only CUDA 13 bindings.
227+
toolkit = raw["cuda"]["build"]["version"]
228+
if _TOOLKIT_VERSION_PATTERN.fullmatch(toolkit) is None or not toolkit.startswith("13."):
228229
raise ValueError("legacy release compatibility requires a CUDA 13 build toolkit")
229-
current_root = (
230-
"cuda_bindings_13" if (release_source_root / "cuda_bindings_13").is_dir() else "cuda_bindings"
231-
)
232-
package = BindingsPackage(current_root, tuple(map(int, current_toolkit.split("."))), "current")
233-
if bindings_version is not None and bindings_version.release[0] == 12:
234-
maintenance_toolkit = raw["cuda"]["prev_build"]["version"]
235-
if _TOOLKIT_VERSION_PATTERN.fullmatch(maintenance_toolkit) is None:
236-
raise ValueError("legacy prev_build toolkit must have major.minor.patch format")
237-
package = BindingsPackage(
238-
"cuda_bindings_12", tuple(map(int, maintenance_toolkit.split("."))), "maintenance"
239-
)
230+
root = "cuda_bindings_13" if (release_source_root / "cuda_bindings_13").is_dir() else "cuda_bindings"
231+
package = BindingsPackage(root, tuple(map(int, toolkit.split("."))), "current")
240232
else:
241233
config = parse_config(raw)
242234
package = (
@@ -250,16 +242,14 @@ def resolve_release_bindings_package(
250242
)
251243
if bindings_version is not None and not package.matches_tag(release_tag):
252244
raise ValueError(f"release tag {release_tag!r} does not match tagged toolkit {package.toolkit_version}")
253-
if legacy_config and not (release_source_root / package.package_root).is_dir():
254-
raise ValueError(f"tagged source has no bindings root {package.package_root!r}")
255245

256246
record: dict[str, object] = {
257247
"package_root": package.package_root,
258248
"toolkit_version": package.toolkit_version,
259249
}
260250
if bindings_version is not None:
261251
record["release_version"] = str(bindings_version)
262-
if legacy_config and package.release_status == "current":
252+
if legacy_config:
263253
record["allow_legacy_python_artifact"] = True
264254
return record
265255

@@ -292,18 +282,7 @@ def main(argv: list[str] | None = None) -> int:
292282

293283
try:
294284
if args.command == "write-github-env":
295-
if (
296-
args.package_roots
297-
or args.check_package_metadata
298-
or args.release_status
299-
or args.release_tag
300-
or args.release_source_root is not None
301-
):
302-
parser.error("write-github-env does not accept registry selectors")
303-
value = json.load(sys.stdin)
304-
if not isinstance(value, dict):
305-
raise ValueError("stdin for write-github-env must contain a JSON object")
306-
write_github_env(value, args.github_env)
285+
write_github_env(json.load(sys.stdin), args.github_env)
307286
return 0
308287
if args.release_tag:
309288
if args.release_source_root is None:

‎ci/tools/tests/test_bindings_release_compat.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _source(root, *, old=False, schema2=False):
3434
("old", "schema2", "tag", "expected_root", "legacy_artifact"),
3535
[
3636
(True, False, "v13.4.4", "cuda_bindings", True),
37-
(False, False, "v12.9.11", "cuda_bindings_12", False),
37+
(False, False, "v13.4.4", "cuda_bindings_13", True),
3838
(False, True, "v12.9.11", "cuda_bindings_12", False),
3939
(False, True, "v13.4.9", "cuda_bindings_13", False),
4040
],
@@ -48,10 +48,10 @@ def test_tagged_source_compatibility(tmp_path, old, schema2, tag, expected_root,
4848
assert record.get("allow_legacy_python_artifact", False) is legacy_artifact
4949

5050

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"):
51+
@pytest.mark.agent_authored(model="claude-fable-5-2")
52+
def test_schema_less_source_cannot_resolve_cuda12(tmp_path):
53+
source, _ = _source(tmp_path)
54+
with pytest.raises(ValueError, match="does not match tagged toolkit"):
5555
resolve_release_bindings_package("v12.9.11", source)
5656

5757

‎ci/tools/validate_release_wheels.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def version_from_tag(
8989
def _release_python_versions(release_source_root: Path) -> list[str]:
9090
path = release_source_root / _VERSIONS_CONFIG
9191
config = yaml.safe_load(path.read_text(encoding="utf-8"))
92-
if "python" in config or "schema_version" in config:
92+
if "python" in config:
9393
return config["python"]["supported"]
9494
# Retained CUDA 13 tags predate the shared Python-version list.
9595
workflow = release_source_root / ".github/workflows/build-wheel.yml"

0 commit comments

Comments
 (0)