Skip to content

Commit 4362679

Browse files
ci(py-315): shorten the cp315 comment and type-annotate the validator delta
1 parent 1d382ed commit 4362679

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

.gitlab/validate-ddtrace-package.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
# Configuration
32-
PYTHON_TAGS = ["cp39", "cp310", "cp311", "cp312", "cp313", "cp314", "cp315"]
32+
PYTHON_TAGS: list[str] = ["cp39", "cp310", "cp311", "cp312", "cp313", "cp314", "cp315"]
3333
WIN_ARM64_PYTHON_TAGS = ["cp311", "cp312", "cp313", "cp314"]
3434

3535
BASE_PLATFORMS = [
@@ -44,24 +44,14 @@
4444
]
4545
SERVERLESS_PLATFORMS = [p for p in BASE_PLATFORMS if "linux" in p]
4646

47-
# cp315 is best-effort: no cp315 wheel is required, and a cp315 Linux wheel is
48-
# tolerated when one does land. The macOS and Windows matrices stop at 3.14, and
49-
# every cp315 leg of "build linux" is allow_failure in package.yml, so requiring a
50-
# cp315 wheel here would turn a build that the pipeline is explicitly allowed to
51-
# lose into a hard failure of "ddtrace package" -- which has no allow_failure and
52-
# gates the release stage. 4.14.0 shipped cp315 musllinux but no cp315 manylinux,
53-
# and would have been blocked by such a requirement.
54-
# TODO(py-315): keep this in lockstep with the cp315 allow_failure rule in
55-
# package.yml. Populating it while that rule stands re-creates the hard failure
56-
# above; dropping the rule without populating it leaves cp315 unvalidated. #17816
57-
# owns the flip and must do both at once.
47+
# cp315 is optional: none required; tolerate Linux wheels if they land.
5848
REQUIRED_PLATFORMS: dict[str, list[str]] = {"cp315": []}
59-
OPTIONAL_WHEELS = {("cp315", p) for p in BASE_PLATFORMS if "linux" in p}
49+
OPTIONAL_WHEELS: set[tuple[str, str]] = {("cp315", p) for p in BASE_PLATFORMS if "linux" in p}
6050

6151

6252
def required_platforms(py_tag: str, platforms: list[str]) -> list[str]:
6353
"""Restrict platforms for Python versions that are not built everywhere."""
64-
allowed = REQUIRED_PLATFORMS.get(py_tag)
54+
allowed: list[str] | None = REQUIRED_PLATFORMS.get(py_tag)
6555
if allowed is None:
6656
return platforms
6757
return [p for p in platforms if p in allowed]
@@ -238,7 +228,7 @@ def main(args: argparse.Namespace) -> None:
238228
# Phase 4: Build Expected Set
239229
print("[Phase 4] Building Expected Set")
240230
expected_set = build_expected_set(package_version, args)
241-
unrestricted_tags = [t for t in PYTHON_TAGS if t not in REQUIRED_PLATFORMS]
231+
unrestricted_tags: list[str] = [t for t in PYTHON_TAGS if t not in REQUIRED_PLATFORMS]
242232
print(f"Expected {len(expected_set)} wheels:")
243233
print(
244234
f" - {len(unrestricted_tags)} Python versions ({unrestricted_tags[0]}-{unrestricted_tags[-1]})"
@@ -274,7 +264,7 @@ def main(args: argparse.Namespace) -> None:
274264
# Unexpected wheels
275265
unexpected_wheels = actual_set - expected_set
276266
# Filter out version mismatches (they're already reported)
277-
unexpected_non_version = [
267+
unexpected_non_version: list[tuple[str, str, str, str]] = [
278268
(v, p, pl, fl)
279269
for v, p, pl, fl in unexpected_wheels
280270
if reconstruct_wheel_filename(v, p, pl, fl) not in version_mismatches and (p, pl) not in OPTIONAL_WHEELS

0 commit comments

Comments
 (0)