-
-
Notifications
You must be signed in to change notification settings - Fork 249
Description
In Python 3.12, the stdlib's ensurepip and venv modules were updated to no longer install setuptools 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.
As such, when using the default Python configure options (which include --with-ensurepip, which causes ensurepip to run during the build), the resultant Python build only includes pip and not setuptools for Python 3.12+.
For example, this then means the Python distribution used by the official GitHub Actions setup-python action (which don't override the upstream CPython configure defaults) automatically only ships setuptools for Python 3.11 and older:
# Python 3.11
$ curl -sSfL https://github.com/actions/python-versions/releases/download/3.11.9-9947079978/python-3.11.9-linux-24.04-arm64.tar.gz | tar -zt | grep -E 'site-packages/[^/]+/$'
./lib/python3.11/site-packages/pip-24.0.dist-info/
./lib/python3.11/site-packages/_distutils_hack/
./lib/python3.11/site-packages/pkg_resources/
./lib/python3.11/site-packages/pip/
./lib/python3.11/site-packages/setuptools/
./lib/python3.11/site-packages/setuptools-65.5.0.dist-info/
# Python 3.12
$ curl -sSfL https://github.com/actions/python-versions/releases/download/3.12.5-10375840348/python-3.12.5-linux-24.04-arm64.tar.gz | tar -zt | grep -E 'site-packages/[^/]+/$'
./lib/python3.12/site-packages/pip-24.2.dist-info/
./lib/python3.12/site-packages/pip/
However, the builds performed by this project configure Python using --without-ensurepip, and then manually install pip and setuptools afterwards:
https://github.com/indygreg/python-build-standalone/blob/90d40b46d929eabafee1e3320ab54d32efdf258e/cpython-unix/build-cpython.sh#L546-L547
This means that when Python 3.12 builds were added in 2a5f3a9 they didn't automatically pick up this upstream CPython change.
For parity with upstream Python's behaviour, the builds here should stop explicitly installing setuptools for Python 3.12+.
See also:
- Remove bundled setuptools python/cpython#95299
- python/cpython@ece20db
- Stop installing
setuptoolsandwheelby default on Python 3.12+ environments pypa/virtualenv#2487 - Remove setuptools & wheel from seed packages (#1602) uv#1613
- Stop installing setuptools and wheel on Python 3.12+ pypa/get-pip#218
- Stop installing setuptools in python 3.12+ docker-library/python#954