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
PEP 632: Remove the distutils package (Python 3.12) #92584
Comments
Rename Lib/distutils/ directory to Lib/_distutils/.
I reported this issue to pip: pypa/pip#11103 |
|
The distutils package was deprecated by the issue #85454. |
|
PEP 632 "Deprecate distutils module": https://peps.python.org/pep-0632/ |
|
That seems like a good plan. Thanks. |
|
My fear with renaming it is that it lingers indefinitely, and diverging in subtle ways from pypa/distutils. Why not address the dependencies and fully remove the functionality? Regardless, I agree renaming is preferable to not removing the module at all. |
Someone has to modify Python to no longer depend on distutils. The issue description lists code using it. It doesn't seem trivial. |
|
Would it be reasonable to keep it around in the repo while we don't drop the dependency but not ship it as part of Python installations? |
With my PR, the |
|
Do note that we have buildbots that run from an installed Python. The tests would need to also be modified to fail gracefully |
I propose skipping tests relying on _distutils if _distutils is not available. |
Rewrite test_cppext to run in a virtual environment and to build the C++ extension with setuptools rather than distutils.
test_decimal now uses shutil.which() rather than deprecated distutils.spawn.find_executable().
|
I wrote two PRs to avoid the deprecated distutils module in two tests:
|
test_decimal now uses shutil.which() rather than deprecated distutils.spawn.find_executable().
Rewrite test_cppext to run in a virtual environment and to build the C++ extension with setuptools rather than distutils.
|
Marking as 3.12.0a1 release blocker. We want to have public-facing distutils gone in the first alpha, to have as much time as possible to deal with the fallout. |
|
Actually we can get rid of distutils entirely. I have a working PR that gets rid of our |
`make test_cppmods` compiles C++ test extension modules.
It seems that 3.12.0a1 was released with distutils. Was that intentional? cc. @Yhg1s |
|
I was going to ping the issue during the core dev sprint and then intentionally ignore it for the alpha 1 release (using it more as a practice run rather than trying to get everything right) -- but then I accidentally ignored it instead |
|
Not sure why this got put on me. If nobody else wants to do it, I can get to it eventually, but I definitely don't want to prevent anyone else from taking the honours. |
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 Doc/installing/ directory * Remove test_distutils * Remove references to distutils * Skip test_check_c_globals and test_peg_generator since they use distutils
|
Since May, the situation evolved:
Thanks to that, I was able to create PR #99061. This PR removes the distutils package. It always skips test_check_c_globals and test_peg_generator since they use distutils. I prefer to remove distutils now, and fix these tests later, rather than missing the next Python 3.12 alpha release. |
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 Doc/installing/ directory * Remove test_distutils * Remove references to distutils * Skip test_check_c_globals and test_peg_generator since they use distutils
The _bootsubprocess module was removed in pythongh-93939 by commit 81dca70.
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
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
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 commentedMay 9, 2022
•
edited by bedevere-bot
The distutils module was deprecated in Python 3.10 and is scheduled for removal in Python 3.12.
Right now, Python still uses distutils for different purpose:
Tools/c-analyzer/uses distutils to get a C preprocessor.Until Python can be built and used without distutils, I propose to first rename the
distutilspackage to_distutils: rename thLib/distutils/directory toLib/_distutils/.Right now, test_venv fails without distutils, because pip fails on importing the distutils module in
pip/_internal/locations/_distutils.py: https://github.com/pypa/pip/blob/cb24fb4052ca8ab8009866b0de61980c81a7e13c/src/pip/_internal/locations/_distutils.py#L9-L12I created the PR #92585 which renames distutils to _distutils.
The text was updated successfully, but these errors were encountered: