meson-python: platform_tag is wrong on macOS for Homebrew Python
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?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26 (26 by maintainers)
More precisely, until a new
pip
release comes out that vendors a fixedpackaging
(https://github.com/pypa/pip/tree/main/src/pip/_vendor/packaging)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
packaging
release with the fix comes out, so other people are likely to run into this. Hence I’ll reopen this and add a “dependency-bug” label. Once the fix is out, we should bump the minimumpackaging
version in this repo so it includes that fix.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
distutils.util.get_platform
, which we have to recreate now in the downstream becausedistutils
is deprecated. We can usewheel.macosx_libfile.calculate_macosx_platform_tag
.https://github.com/pypa/wheel/blob/main/src/wheel/bdist_wheel.py and https://github.com/pypa/wheel/blob/main/src/wheel/macosx_libfile.py also have relevant code.