Document that macOS platform tags use minor version 0 for macOS 11+

When macOS switched from the 10.x series to the new versioning scheme incrementing the major version with macOS 11, packaging and subsequently pip and uv decided to only emit tags with the minor version 0 for macOS 11+, since we don’t know how many minors each version has. This means that only macosx_{major}_0 platform tags work, other minor versions will mismatch.

This behavior is currently not documented, specifically Platform compatibility tags - Python Packaging User Guide doesn’t say anything about it. PyPI allows uploading those wheels, even though they are unusable with installers, leading to confusion with users (Unable to install wheel with macosx_14_5 platform tag on macOS 15.6.1 · Issue #16337 · astral-sh/uv · GitHub).

I’d like to propose to codify the existing practice of packaging, pip and uv of only supporting the 0 minor version in platform tags and document it in Platform compatibility tags - Python Packaging User Guide. This way, PyPI can reject those uploads and we avoid the user confusion (Ban macOS 11+ minor tags not supported by pip, packaging nor uv by konstin · Pull Request #18959 · pypi/warehouse · GitHub).

See Clarify allowed minor version of macos tags · Issue #1933 · pypa/packaging.python.org · GitHub for prior discussion, which spawn this thread.

3 Likes

If this limitation remains, it seems reasonable to document it with at least a warning somewhere indeed.

Codifying this as the design seems more questionable, since it was a pretty ad-hoc decision in the packaging library, and it could be changed/improved. The most relevant issue is Missing valid mac tags · Issue #578 · pypa/packaging · GitHub I believe. Most participants there agree that adding support for minor versions makes sense, it’s just work and the current packaging design of pre-generating a full list of valid versions is getting in the way a bit.

3 Likes

I’m impartial to which version we pick. Unless someone has a strong motivation about changing this now, would it be possible to separate being consistent about the current de-facto standard throughout the ecosystem from changing it?

Specifically, I’m thinking about documenting this as current behavior on packaging.python.org and blocking uploads on PyPI (Codify that macOS platform tags use minor version 0 for macOS 11+). Both of those are reversible, we can extend the set of allowed and supported platform tags without breaking users (the wheels will be ignored by older pip versions). For the documentation, I’m planning to add a disclaimer that platform tags are subject to change, similar to this paragraph from std::io - Rust :

Note, however, that this is informative, not a binding contract. The implementation of many of these functions are subject to change over time and may call fewer or more syscalls/library functions.

The current state is that there is a de-facto standard set by packaging (and pip and uv), but users aren’t informed about it (no info on packaging.python.org), and users don’t get warned that their packages are broken (no pypi.org error): A worse user experience than either having or not having minor version tags consistently. I’m not trying to preclude consensus or trying to make something more official that it is, but trying to make the best out of https://github.com/pypa/packaging/pull/319 effectively having made a decision in that PR, this being adapted in pip and uv, while packaging.python.org hasn’t been updated.

2 Likes

:+1: that sounds perfectly reasonable to me, as does your plan on what to change right now.

1 Like

For visibility @konstin has raised the PR on the PPO repo: Document `macosx_0_{y}_{arch}` pattern for macOS 11+ by konstin · Pull Request #1958 · pypa/packaging.python.org · GitHub