-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
PEP 632, deprecation of distutils and numpy.distutils #18588
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
Comments
If we're just going to deal with the
If we're going to do a ton of work, the time is now though to move to a build system that doesn't hate compilers and has a sane design. Here is the plan for SciPy and I'm slowly moving that forward: scipy/scipy#13615 (likely will start moving faster soon). If that move is successful, we should do the same for NumPy. |
My thinking on this topic has evolved a bit.
|
The question then becomes how we communicate changes. We could:
|
By far the most widely used |
Bumping the milestone, but if there is anyting important for the 1.23.0 release with respect to this issue, please make a note! |
Given that NumPy does not build with the We are moving away from I'll link to a new tracking issue for the build system migration to Meson soon, need to summarize the current plan and status. |
I can confirm numpy does not install with either setuptool 59 or the latest (did not check any in between) with py312. |
As a stopgap, someone could potentially put a forward-port of |
Does this work to build NumPy? If I understand correctly, @tacaswell commented above that it does not. |
On Setuptools <=59, Setuptools' copy of However, the forward-port on PyPI would be a much better solution overall, since it wouldn't require any changes to NumPy other than adding it to NumPy's build time and runtime requirements, and/or users manually installing it themselves. This will unblock building NumPy from source/sdist for 3.12, to not block early porting and testing to that version while the Meson migration is underway, or as a fallback plan in case it isn't fully ready. If it was not needed at runtime to support Of course, up to you all how you feel its best to approach that...though, IMO, we should still go ahead with the |
My $2c:
|
Just FYI, the first alpha is typically released right around the same time as the previous version .0 release, and the nominal goal is to have as many of the planned removals in by the first alpha as practical, so that downstream packages can start testing with it early and maintainers, contributors, distributors, etc. can identify issues as soon as possible to make progress on fixing them, and provide feedback upstream. In this case, Alpha 1 was released a bit later than usual, around a week or two ago, and while it was specifically planned to be sure that the Its certainly a possibility its reverted, but for better or for worse, the Setuptools changes with overriding the stdlib distutils mean that any packages, whether with legacy or PEP 517 builds, that are building in an environment with Setuptools installed (which is the great majority of the time) and don't explicitly require <=59 or happen to have it (probably not so likely with CPython 3.12), will already behave the same whether or not |
I also have little interest in doing the work to put a forward port on pypi. I would much rather put the effort into helping packages affected by this move to meson.
It does not work out of the box, but I have not tried setting the relevant ENV yet. |
Okay, if someone really needs NumPy for Python 3.12 right now, the EDIT: scratch that, NumPy is updated but Meson itself still relies on |
Sysconfig is not (yet) a full replacement for distutils, because Meson sneakily uses a distutils Extension() object and checks whether it depends on libpython to figure out whether extensions need to be linked to the DLL on the current platform. I intend to discuss this with CPython soon, but in the meantime, setuptools on python 3.12 will inject distutils and Meson's use is so simple that it currently still works with setuptools' patches (obviously due to setuptools' lack of API stability, no promises...), so... ... Installing setuptools as a build dependency should work as a quick hack to run Meson on the alphas. Obviously, this is a quick hack and Meson is not going to rely on this for the final release of python 3.12. ;) |
With the hint to install setuptools > 60 I was able to get numpy to compile and install
from the meson branch. |
The above commands does not install the dist-info, copying that directory (and accepting the lies) seems to get the rest of the stack building again. |
I'm also getting numpy reporting a version of |
Should be fixed in the |
What is the intended plan for the usage of distutils inside |
I'll close this issue, since we are basically done with this transition. NumPy 1.26.x defaults to Meson as the new build system, and No |
It looks like PEP 632 with the deprecation of distutils in stdlib and removal in Python 3.12 was accepted.
How would it impact numpy.distutils ? Does it mean that distutils would be added as a stand-alone build dependency (even if it's deprecated) or are there some other long term plans for numpy.distutils?
The text was updated successfully, but these errors were encountered: