mesonbuild / meson-python

Meson PEP 517 Python build backend
https://mesonbuild.com/meson-python/
MIT License
118 stars 59 forks source link

MAINT: improve support for free-threaded CPython #621

Closed rgommers closed 2 months ago

rgommers commented 2 months ago

As noted in https://github.com/pypa/packaging/issues/727, free-threaded CPython does not support the limited API. Hence raise an exception if a limited-api build is requested.

Also skip/update a few tests that were failing when run under a free-threaded interpreter.

Note that we are already producing the correct wheel tags, since that comes from sysconfig.get_config_var('EXT_SUFFIX').

Addresses part of gh-499. There will be more to do - most importantly adding a CI job. This probably only makes sense to do once the setup-python action adds support (xref https://github.com/actions/setup-python/issues/771). This may happen around the CPython 3.13 beta 1 release (May 7th).

I'll add notes on how to test with a free-threaded build on gh-499 (it's not completely trivial yet).

rgommers commented 2 months ago

Looks like a typo fix in pyproject-metadata 0.8.0 is messing with CI here:

FAILED tests/test_sdist.py::test_pep621 - AssertionError: assert 'Metadata-Ver...1 metadata!\n' == 'Metadata-Ver...1 metadata!\n'

  Skipping 116 identical leading characters in diff, use -v to show
  Skipping 906 identical trailing characters in diff, use -v to show
  - ords: full metadata
  ?           ^
  + ords: full,metadata
  ?           ^

gh-613 has a draft fix already, but with more changes. Do you want to finish that PR, or should we fix this typo failure separately first?

dnicolodi commented 2 months ago

Looks like a typo fix in pyproject-metadata 0.8.0 is messing with CI here:

This should be fixed in main already. I think you just need to rebase on current main.