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)

Most upvoted comments

It’s not actually fixed until a new packaging release with the fix comes out

More precisely, until a new pip release comes out that vendors a fixed packaging (https://github.com/pypa/pip/tree/main/src/pip/_vendor/packaging)

I see a second issue, the ABI tag is incorrect:

I think that was just #95, can you check against main?

Correct, that was gh-95, unrelated to this issue.

Opened pypa/packaging#578, so I’ll close this.

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 minimum packaging version in this repo so it includes that fix.

Does that help much / is that going to be robust?

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 because distutils is deprecated. We can use wheel.macosx_libfile.calculate_macosx_platform_tag.