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
platform_tag is wrong on macOS for Homebrew Python #91
Comments
I see a second issue, the ABI tag is incorrect:
The
|
I double checked on Linux, and (as expected) it's fine there: |
Hmm, after looking into this some more, this is indeed very incomplete:
I agree, there's no need to reinvent this wheel. That file is compatibly-licensed, so can be reused. |
The big difference from our code to pypa/packaging is that we derive our tags directly from the extension modules, while pypa/packaging tries to list all compatible tags for the current interpreter. While I still think our code is valuable, but we should definitely make use of pypa/packaging too. |
Does that help much / is that going to be robust? On Linux I see a useful extension, like |
Yep, because the modules can be built with the stable ABI for eg. In Linux it seems the extension tag are a direct mapping but this is not the case for macOS. Unfortunately, the spec says the correct platform-specific tag is defined by |
Makes sense. I actually wouldn't know how we'd go from "detect this uses the stable ABI" to extension name. Does |
No, I don't think sysconfig has any knowledge of this, as it doesn't really need to. We just check if all extensions are using the stable ABI and if so we use the stable ABI tag in the wheel. |
Maybe I am missing the point, so let me rephase: I think you are checking the extension name in |
That would be Meson. IIRC Meson won't let you easily create a stable ABI extension easily, but that can be done manually. For this to be done correctly, you should set |
I suppose that is something that could be added to Meson if people want it. Personally, I haven't really seen the limited API used in projects much... The implementation would probably look something like |
Hi Eli, that sounds like a good proposal. I would probably call the option something like See https://docs.python.org/3/c-api/stable.html#stable-application-binary-interface
Which itself is based on '.'.join(extension_name, 'abi3', sysconfig.get_config_var('SHLIB_SUFFIX'))' |
Sure, many of the sysconfig variables are based on each other. It was convenient for simplicity to use that one. I feel a bit scared to actually change the variables used, considering that it's not really well documented what variables are there or which ones to use for any given situation. :( |
You can keep using |
Now that I have a macOS machine, I have reproduced this. The thing is, >>> distutils.util.get_platform()
'macosx-12-arm64'
>>> sysconfig.get_platform()
'macosx-12-arm64' The issue here is that pypa/packaging does not consider >>> list(packaging.tags.mac_platforms())
['macosx_12_0_arm64',
'macosx_12_0_universal2',
'macosx_11_0_arm64',
'macosx_11_0_universal2',
'macosx_10_16_universal2',
'macosx_10_15_universal2',
'macosx_10_14_universal2',
'macosx_10_13_universal2',
'macosx_10_12_universal2',
'macosx_10_11_universal2',
'macosx_10_10_universal2',
'macosx_10_9_universal2',
'macosx_10_8_universal2',
'macosx_10_7_universal2',
'macosx_10_6_universal2',
'macosx_10_5_universal2',
'macosx_10_4_universal2']
I think that was just #95, can you check against |
Opened pypa/packaging#578, so I'll close this. @rgommers once you manage to verify if the bug you mentioned still exists, please open a new issue if it does. Once that is done, I think we can do a release. Thanks! @mkoeppe do let me know if you have further feedback or you think I missed anything 😊 |
Correct, that was gh-95, unrelated to this issue.
I determined that the problem is Homebrew-specific, so I'll update the title of this issue. It's not actually fixed until a new |
More precisely, until a new |
Thanks for the correction. Or, alternatively, if Homebrew fixes what they're doing here - or we add a workaround for it in this package. |
+1 on preparing a workaround. |
This was fixed in gh-111, which is in |
Thanks a lot, I confirm that it fixes the problem. |
I now have a similar problem on Linux 32-bit userspace on 64-bit, opened #123 |
This problem on macOS has come back with meson-python 0.9.0 |
That's not the same, let me open a new issue to discuss. |
meson-python 0.6.0 generates a wheel the platform tag
macosx_12_x86_64
, which cannot be installed by pip.Ref: https://trac.sagemath.org/ticket/34081#comment:15
Why not use https://github.com/pypa/packaging/blob/main/packaging/tags.py?
The text was updated successfully, but these errors were encountered: