Skip to content
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

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

Merged
merged 5 commits into from
Oct 22, 2023

Conversation

dnicolodi
Copy link
Member

No description provided.

@dnicolodi dnicolodi force-pushed the test-meson-rm-distutils branch 15 times, most recently from 5988d25 to b99ec1a Compare September 9, 2023 23:54
@dnicolodi dnicolodi changed the title WIP: test with meson#12237 WIP: test with meson branch removing distutils dependency when using Python 3.12 Sep 10, 2023
@dnicolodi dnicolodi changed the title WIP: test with meson branch removing distutils dependency when using Python 3.12 WIP: test meson branch removing distutils dependency when using Python 3.12 Sep 10, 2023
@dnicolodi dnicolodi changed the title WIP: test meson branch removing distutils dependency when using Python 3.12 WIP: test meson removing distutils dependency when running Python 3.12 Sep 10, 2023
@dnicolodi
Copy link
Member Author

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: cython/cython#5692, fixed in cython/cython#5693, and cython/cython#5694, but the latter is just a documentation issue.

cclauss

This comment was marked as off-topic.

@dnicolodi dnicolodi force-pushed the test-meson-rm-distutils branch 4 times, most recently from 5bf5454 to 128a213 Compare September 19, 2023 09:47
@dnicolodi dnicolodi force-pushed the test-meson-rm-distutils branch 2 times, most recently from 16ad7fd to 31f1e5b Compare September 22, 2023 22:45
@dnicolodi
Copy link
Member Author

dnicolodi commented Oct 5, 2023

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
Copy link
Contributor

rgommers commented Oct 5, 2023

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 dnicolodi force-pushed the test-meson-rm-distutils branch 6 times, most recently from 99b376a to 2f8bd53 Compare October 6, 2023 07:29
Cython 3.0.3 does not require distutils and thus works on Python 3.12
without having to install setuptools.
Require a Meson version that does not rely on distutils when operating
on Python 3.12 where the distutils module has been removed. This
allows to remove the conditional setuptools dependency on Python 3.12.
@dnicolodi dnicolodi changed the title WIP: test meson removing distutils dependency when running Python 3.12 MAINT: bump minimum required Meson version on Python 3.12 Oct 22, 2023
@dnicolodi dnicolodi marked this pull request as ready for review October 22, 2023 18:18
@dnicolodi
Copy link
Member Author

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.

Copy link
Contributor

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. This all LGTM, in it goes. Thanks @dnicolodi!

@rgommers rgommers merged commit 962585e into mesonbuild:main Oct 22, 2023
38 checks passed
@rgommers rgommers added the maintenance Regular code improvements that are not new features nor end-user-visible bugs label Oct 22, 2023
@rgommers rgommers added this to the v0.15.0 milestone Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Regular code improvements that are not new features nor end-user-visible bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants