-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Stop including setuptools and wheel in Python 3.12+ images #952
Comments
Thank you for the very detailed analysis/breakdown ❣️ I agree we should fix this, and I really like the fix being removing more things we shouldn't be including by default (because they're not part of the official upstream distribution) -- |
In Python 3.12, the stdlib's
ensurepip
andvenv
modules were updated to no longer installsetuptools
alongside pip. This was viable since as of pip v22.1, for pre-PEP-517/518 packages pip will now default to the isolated build environment mode (along with a fallback legacy setuptools build backend, with setuptools and wheel automatically installed), if the setuptools package isn't installed globally.See:
python/cpython#95299
python/cpython@ece20db
As such, when this repo added support for Python 3.12, the explicit setuptools requirement was removed, as part of:
#833
However, that change didn't actually remove setuptools from the Python 3.12+ images, since get-pip implicitly installs setuptools and wheel if they are not already installed. Instead, the result was only that the setuptools version is now unconstrained and get-pip will pull in whatever is the latest version of setuptools at the time of the image being built.
eg:
This means that the Python 3.12 (and 3.13-rc) images here:
(a) are less aligned with the experience one gets when using
ensurepip
orvenv
from the stdlib (which no longer install setuptools),(b) now have a floating setuptools version when they didn't before (which doesn't seem ideal from a determinism point of view, particularly given intentional breaking changes in recent setuptools major releases as part of an ongoing tech-debt clean-up effort).
I think it would be best if the packages in these images were consistent with the environment created by
ensurepip
/venv
. Which for Python 3.12+ would mean not shipping with setuptools or wheel.There are a few ways this could be done:
--no-setuptools
and--no-wheel
when invoking get-pip.py.See also:
setuptools
andwheel
by default on Python 3.12+ environments pypa/virtualenv#2487The text was updated successfully, but these errors were encountered: