mesonbuild / meson-python

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

MAINT: bump minimum required Meson version on Python 3.12 #492

Closed dnicolodi closed 8 months ago

dnicolodi commented 9 months ago

The meson branch works as advertised, meson-python requires small tweaks to drop the setuptools dependency when a sufficiently nee meson is used. The testing found an unrelated issue in meson-python #494 and two Cython bugs: https://github.com/cython/cython/issues/5692, fixed in https://github.com/cython/cython/pull/5693, and https://github.com/cython/cython/issues/5694, but the latter is just a documentation issue.

dnicolodi commented 9 months ago

The required change to drop the use of distutils have been merged in meson. We need to decide what we want to do on the meson-python side. Up until now we require setuptools when running on Python 3.12 or later. What I've implemented in this PR is to use the get_requires_for_build_wheel() hook to request setuptools if running on Python 3.12 or later and the meson version is known to still require distutils. This works, but I don't like the added complexity. What we could do is simply bump the minimum required meson version with something like this in pyproject.toml:

dependencies = [
  'colorama; os_name == "nt"',
  'meson >= 0.63.3; python_version < "3.12"',
  'meson >= 1.2.3; python_version >= "3.12"',
  'pyproject-metadata >= 0.7.1',
  'tomli >= 1.0.0; python_version < "3.11"',
]

This has the drawback to require a very recent (at the moment not yet released) version of meson on Python 3.12. I don't know whether this may be an issue in practice. Of course we can do this only when a suitable meson version is actually released.

rgommers commented 9 months ago

Changing to 'meson >= 1.2.3; python_version >= "3.12"', as soon as Meson 1.2.3 is released seems like a good solution.

dnicolodi commented 8 months ago

Meson 1.2.3 has been released dropping the requirement for distutils on recent Pythons. We don't need to pull in setuptools anymore on Python 3.12.