gh-92584: Remove the distutils package#99061
Conversation
|
There are still many references to distutils. I prefer to remove/update them in separated PRs to keep this PR as small as possible. |
Sorry, something went wrong.
|
The doc build fails when I just removed It should be removed in a separated PR. |
Sorry, something went wrong.
|
Optional Windows (x86) CI job failed, I re-run the job ("2 re-run tests: test_asyncio test_threading"). It's just a random error, unrelated to this PR. |
Sorry, something went wrong.
|
My colleague @hroncok is already preparing Python packages in Fedora for this removal: Help needed triaging build failures without distutils. 250 packages are impacted: a build dependency to setuptools should be added to get distutils. |
Sorry, something went wrong.
A handful of packages also falls to build with setutpools, because the distutils module from setuptools is not backward compatible with distutils. |
Sorry, something went wrong.
zware
left a comment
There was a problem hiding this comment.
LGTM (though there's two more lines that can be removed in PC/layout/support).
Sorry, something went wrong.
That's... very scary :-( |
Sorry, something went wrong.
|
The naming is confusing, but Meanwhile, @vstinner Would you like me to help take care of the docs changes/removals in a followup PR, since I'm fairly familiar with them? They're also somewhat covered by a separate issue, #94249 |
Sorry, something went wrong.
Remove the distutils package. It was deprecated in Python 3.10 by PEP 632 "Deprecate distutils module". For projects still using distutils and cannot be updated to something else, the setuptools project can be installed: it still provides distutils. * Remove Lib/distutils/ directory * Remove test_distutils * Remove references to distutils * Skip test_check_c_globals and test_peg_generator since they use distutils
|
The test suite passed on most buildbots: great! I will not wait for the few remaining buildbots (like Refleaks buildbots, removing pure Python code is unlikely to introduce such leak). I addressed @zware's review in a second commit. I will merge my PR as soon as the CI pass on it. |
Sorry, something went wrong.
Yes! Help on updating the doc is welcomed. There is a lot of documentation mentioning distutils, and deciding if the doc must be removed or not is not easy. |
Sorry, something went wrong.
|
Ok, I removed the distutils packages. Now test_check_c_globals and test_peg_generator should be updated to no longer use distutils. And remaining references to distutils #99061 (comment) should be removed. @CAM-Gerlach is volunteer to handle the Doc/ part. |
Sorry, something went wrong.
Remove the distutils package. It was deprecated in Python 3.10 by PEP 632 "Deprecate distutils module". For projects still using distutils and cannot be updated to something else, the setuptools project can be installed: it still provides distutils.