Uh oh!
There was an error while loading. Please reload this page.
gh-92584: Remove the distutils package - #99061
Conversation
vstinner
commented
Nov 3, 2022
There are still many references to distutils. I prefer to remove/update them in separated PRs to keep this PR as small as possible. |
vstinner
commented
Nov 3, 2022
The doc build fails when I just removed It should be removed in a separated PR. |
vstinner
commented
Nov 3, 2022
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. |
vstinner
commented
Nov 3, 2022
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. |
bedevere-bot
commented
Nov 3, 2022
hroncok
commented
Nov 3, 2022
A handful of packages also falls to build with setutpools, because the distutils module from setuptools is not backward compatible with distutils. |
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).
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Nov 3, 2022
That's... very scary :-( |
CAM-Gerlach
commented
Nov 3, 2022
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 |
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
vstinner
commented
Nov 3, 2022
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. |
vstinner
commented
Nov 3, 2022
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. |
vstinner
commented
Nov 3, 2022
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. |
| # Clear assorted module caches. | ||
| # Don't worry about resetting the cache if the module is not loaded |
There was a problem hiding this comment.
This comment isn't specific to distutils. But it's probably not worth putting it back – it's not that hard to see what the code below does.
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.