Fix macOS platform tag detection for conda interpreters (#14267)#18416
Closed
edschofield wants to merge 1 commit intoastral-sh:mainfrom
Closed
Fix macOS platform tag detection for conda interpreters (#14267)#18416edschofield wants to merge 1 commit intoastral-sh:mainfrom
edschofield wants to merge 1 commit intoastral-sh:mainfrom
Conversation
On Intel Macs running macOS 11+, conda's Python is built with MACOSX_DEPLOYMENT_TARGET=10.15. When platform.mac_ver() is called, Apple's SYSTEM_VERSION_COMPAT shim returns "10.16" instead of the real OS version. This causes uv to generate macosx-10.16 platform tags, missing packages that only publish wheels for macOS 11.0+ (e.g. pyarrow, greenlet, duckdb, tabmat). Detect the fake "10.16" version and re-query with SYSTEM_VERSION_COMPAT=0 to get the real macOS version. This matches the behavior of the `packaging` library used by pip. Fixes astral-sh#14267
Collaborator
As a packaging (and pip maintainer), looking forward to one day deleting that code. |
zanieb
reviewed
Mar 12, 2026
| try: | ||
| import subprocess | ||
|
|
||
| real_version = subprocess.run( |
Member
There was a problem hiding this comment.
Should we just be setting SYSTEM_VERSION_COMPAT=0 when running this process in the first place instead of running a second process?
Member
There was a problem hiding this comment.
(From some brief research it seems like we should)
Contributor
Author
There was a problem hiding this comment.
I think you're right. Your approach works in my testing. I'll close this PR and make another one.
Contributor
Author
|
Superseded by this patch: #18436 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes issue #14267 on Intel Macs with conda Python builds.
Details
On Intel Macs running macOS 11+, conda's Python is built with
MACOSX_DEPLOYMENT_TARGET=10.15. Whenplatform.mac_ver()is called, Apple'sSYSTEM_VERSION_COMPATshim returns"10.16"instead of the real OS version. This causesuvto generate macosx-10.16 platform tags, missing packages that only publish wheels for macOS 11.0+ (e.g.pyarrow,greenlet,duckdb,tabmat).This patch detects the fake "10.16" version and re-query with
SYSTEM_VERSION_COMPAT=0to get the real macOS version. It uses the exact same approach as thepackaginglibrary used by pip (see here).With this patch,
uv pip install pyarrow greenlet duckdb tabmatcorrectly installs all four binary wheels in a minimalcondaenvironment my Intel iMac (2020) running macOS 14.8.3 instead of trying (and failing) to build the packages from source.