-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] setuptools' distutils override no longer shows DeprecationWarning #3533
Comments
That behavior is working as intended. The distutils module is deprecated in stdlib, but not in setuptools, which releases at a difference cadence and with broader compatibility across Python versions. I do intend to deprecate distutils now that it's stabilizing without platform-specifc monkeypatches, but it'll take some work to supplant or obviate all of the behaviors on which users currently rely on distutils. Part of the challenge of deprecating distutils is that Setuptools still depends on it, so Setuptools will need to stop using it or suppress the deprecation warnings. |
At first I was surprised not to see the deprecation warning when importing distutils but, I have been trying to wrap my head around it and AFAIU from #417 (comment) and the very PEP 632
distutils is expected to survive distributed alongside setuptools. Therefore, the target audience for the warning in the stdlib would only be those who fail to either make setuptools available or to bootstrap the In a near future, the stdlib distutils codebase will not cease to evolve but to very exist. Then, the copy that is now vendored here will be the de-facto upstream source, and its ownership will fall on setuptools' hands. That said, because distutils is such a mess, everybody should be encouraged to replace any of its functionality with modern alternatives. Setuptools should tell what distutils functionality is a maintenance burden and is to be deprecated and trimmed in every release just like 1701579. In this regard, I think the ball is already on setuptools' roof. But the distutils core does not need to be deprecated unless setuptools wants it so! Namely, the parts that setuptools still relies on. I think the actual challenges are
I hope I am not saying anything stupid. Please tell me so. |
And that's IMO wrong. Since basically every Python distribution and virtual environment comes with setuptools pre-installed, almost nobody gets the deprecation warning. How should users learn that they should move off distutils? This behavior goes against intent of Python core and specification of PEP 632. The change of behavior should have been discussed with us and documented in PEP 632. @zooba |
I think this is fine. The Hopefully the team will figure out a way to deprecate it feature-by-feature and retain enough compatibility for straightforward uses to keep working for as long as possible (I expect by moving implementation into So it's deprecated to use |
setuptools version
setuptools==65.0.1
Python version
any
OS
any
Additional environment information
No response
Description
Recent versions of setuptools override Python stdlib's distutils with
setuptools._distutils
via_distutils_hack
. This version does not contain code to issue deprecation warnings. It's a deviation from upstream code. setuptools should keep the deprecation warning to inform users that they should move from distutils to setuptools.See also #3532
Expected behavior
How to Reproduce
python3 -m venv venv
venv/bin/pip install "setuptools==65.0.1"
venv/bin/python -Werror -c "import distutils"
Output
no output, command does not raise a deprecation warning
The text was updated successfully, but these errors were encountered: