Skip to content

Implement tags/ — PEP 425/600/656 compatibility tags (#18632) - #3

Merged
jonyoder merged 8 commits into
mainfrom
impl-tags
Jul 8, 2026
Merged

jonyoder merged 8 commits into
mainfrom
impl-tags

Conversation

@jonyoder

@jonyoder jonyoder commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Implements the tags/ package per RFD 0001 Phase 0 (#18632): PEP 425/600/656 compatibility tags, target-parameterized (server-side; no host detection).

What's here

  • Tag + ParseTag (3-field dot-Cartesian expansion).
  • Target → Compile() → *Matcher (Tags()/Rank()/IsCompatible()). Compile validates the target and returns ErrUnsupportedTarget for unsupported/malformed input (never panics).
  • Ordered compatible-tag generation: cpython exact→abi3→none→older-abi3 walk→compatible py tiers→cpXY-none-any→universals; manylinux/musllinux with an arch-dependent floor (x86_64/i686→2.5 + legacy aliases; aarch64/etc→2.17; riscv64→2.31; loongarch64→2.36); macOS 11+; windows.
  • Bare linux_<arch> accepted, ranked last among platforms within each ABI tier (PPM local-source/Git-builder wheels; PyPI rejects the tag).

Correctness anchor: golden fixtures generated from Python packaging (host-detection monkeypatched), committed under tags/testdata/ with gen_goldens.py (pinned packaging==26.2). Tests read JSON only — no runtime Python.

Review notes: RoboRev clean on every commit; final whole-branch review (Opus) verdict READY (no reachable Compile() panic; ordering matches packaging across all 7 goldens). Deferred (tracked separately): PEP 703 free-threaded ABI, glibc→distro tables, pre-11 macOS, PyPy-specific ABI.

Closes #18632.

jonyoder added 8 commits July 8, 2026 13:43
Implements the macos branch of platformTags(): macosx_<M>_0_<fmt> for
every major version M from the target's declared major down to 11,
using the arch's binary-format list (x86_64: x86_64/intel/fat64/fat32/
universal2/universal; arm64: arm64/universal2). Pre-11 compatibility
fallbacks are intentionally out of scope.

Also rejects Target.MacMinor < 0 in validate(), matching the existing
PyMinor/LibcMinor guards against a negative-cap Compile panic.

Adds cp310_macos12_arm64 and cp312_macos14_x86_64 golden fixtures
(generated via packaging.tags.mac_platforms, filtered to drop the
pre-11 compatibility tail) plus a focused unit test on arch-dependent
format lists and the 11-floor version walk.
@jonyoder
jonyoder merged commit c6cdbf1 into main Jul 8, 2026
2 checks passed
@jonyoder
jonyoder deleted the impl-tags branch July 8, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant