- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
Ban macOS 11+ minor tags not supported by pip, packaging nor uv #18959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
See pypa/packaging.python.org#1933 When macOS switched to a 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). PyPI doesn't currently enforce this requirement, to the confusion of users who upload wheels that are ultimately not usuable (astral-sh/uv#16337). This PR bans uploads of those wheels, enforcing a minor version of 0 for macOS 11+. Matching implementations in pip and uv: https://github.com/pypa/packaging/blob/a85e63daecba56bbb829492624a844d306053504/src/packaging/tags.py#L452-L460 https://github.com/astral-sh/uv/blob/64bcd4e8a6ad629fa9ffc2922b4cc0cd57cb8dbe/crates/uv-platform-tags/src/tags.rs#L528-L538 (Pending DPO thread)
| Thanks for the PR! Seems like this is the right thing to do, but I would like to see this made explicit in the spec at https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#macos before merging. Do we know where wheels with invalid platform tags are coming from? I.e. is there some build tool producing these that we should try to fix first? This appears to happen infrequently enough that we can probably do this without needing a deprecation period:  | 
| Thanks for checking the DB! I've updated the description with the matching DPO thread: https://discuss.python.org/t/codify-that-macos-platform-tags-use-minor-version-0-for-macos-11/104616. I've been told we need a DPO thread to change packaging.python.org, even though there's already enforcement through the packaging implementation (and uv following that), it's a convoluted situation. 
 No idea, the one report I have from uv is closed source. Setuptools has the correct behavior: https://github.com/pypa/setuptools/blob/8653b91b2b3bdf8a6b77a26d0aa4dd28ffda9bc5/setuptools/_vendor/wheel/macosx_libfile.py#L420-L421 | 
| 
 For at least one recent wheel, the wheel generator is claimed to be  Looks like for another it's  | 
| 
 Huh, the uv build backend does write  | 
| Thanks, both of those confirm my suspicion that this is mostly due to users manually meddling with the tags. | 
See pypa/packaging.python.org#1933
When macOS switched to a 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). PyPI doesn't currently enforce this requirement, to the confusion of users who upload wheels that are ultimately not usuable (astral-sh/uv#16337). This PR bans uploads of those wheels, enforcing a minor version of 0 for macOS 11+.
Matching implementations in pip and uv:
https://github.com/pypa/packaging/blob/a85e63daecba56bbb829492624a844d306053504/src/packaging/tags.py#L452-L460
https://github.com/astral-sh/uv/blob/64bcd4e8a6ad629fa9ffc2922b4cc0cd57cb8dbe/crates/uv-platform-tags/src/tags.rs#L528-L538
DPO thread: https://discuss.python.org/t/codify-that-macos-platform-tags-use-minor-version-0-for-macos-11/104616