Title: Stop including setuptools and wheel in Python 3.12+ images · Issue #952 · docker-library/python · GitHub
Open Graph Title: Stop including setuptools and wheel in Python 3.12+ images · Issue #952 · docker-library/python
X Title: Stop including setuptools and wheel in Python 3.12+ images · Issue #952 · docker-library/python
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 environmen...
Open Graph 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 ...
X 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 ...
Opengraph URL: https://github.com/docker-library/python/issues/952
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stop including setuptools and wheel in Python 3.12+ images","articleBody":"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](https://github.com/pypa/pip/pull/10717) 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.\r\n\r\nSee:\r\nhttps://github.com/python/cpython/issues/95299\r\nhttps://github.com/python/cpython/commit/ece20dba120a1a4745721c49f8d7389d4b1ee2a7\r\n\r\nAs such, when this repo added support for Python 3.12, the explicit setuptools requirement was removed, as part of:\r\nhttps://github.com/docker-library/python/pull/833\r\n\r\nHowever, that change didn't actually remove setuptools from the Python 3.12+ images, since get-pip [implicitly installs setuptools and wheel](https://github.com/pypa/get-pip/blob/ac9253767f0be4cdef620a3ca07187a8cabc66a5/templates/default.py#L46-L78) 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.\r\n\r\neg:\r\n\r\n```\r\n$ docker run -q --rm python:3.12 pip list\r\nPackage Version\r\n---------- -------\r\npip 24.2\r\nsetuptools 72.2.0\r\nwheel 0.44.0\r\n```\r\n\r\nThis means that the Python 3.12 (and 3.13-rc) images here:\r\n(a) are less aligned with the experience one gets when using `ensurepip` or `venv` from the stdlib (which no longer install setuptools),\r\n(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).\r\n\r\nI 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.\r\n\r\nThere are a few ways this could be done:\r\n1. For Python 3.12+, pass `--no-setuptools` and `--no-wheel` when invoking get-pip.py.\r\n2. By switching from get-pip to ensurepip (#951), which would (a) mean these images automatically match the behaviour of the stdlib, (b) mean a lot of the version pinning/handling code can be simplified (since ensurepip defaults to installing the bundled version, not the latest version from PyPI).\r\n3. By waiting for when https://github.com/pypa/get-pip/pull/218 is merged. Though at that point, there is even less reason for this repo to keep using get-pip instead of ensurepip, so we'd probably want to do (2) anyway.\r\n\r\nSee also:\r\n- https://github.com/pypa/virtualenv/issues/2487\r\n- https://github.com/pypa/get-pip/pull/218","author":{"url":"https://github.com/edmorley","@type":"Person","name":"edmorley"},"datePublished":"2024-08-21T15:32:50Z","url":"https://github.com/docker-library/python/issues/952"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:76eaa785-b1b8-6986-8710-377a5c2d4a22 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8122:16B4F1:13EEC5:1B2551:6AFE9084 |
| html-safe-nonce | 52d47f95c4d950e08490617adb9ad1c488c5154daaf5ba2e070724a85effd3be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTIyOjE2QjRGMToxM0VFQzU6MUIyNTUxOjZBRkU5MDg0IiwidmlzaXRvcl9pZCI6IjI3MDA0NzY1MTYxMDk1NTM3OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e5ad104201f0c717794aad48c9c36a88b298cbb78fb66120ef93bd0fefc0289e |
| hovercard-subject-tag | issue:2478361349 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/docker-library/python/952/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b755ac35f133787324dbca7a55b4eef41815238f121cbb59795b04eb993f684a/docker-library/python/issues/952 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b755ac35f133787324dbca7a55b4eef41815238f121cbb59795b04eb993f684a/docker-library/python/issues/952 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | edmorley |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/docker-library/python git https://github.com/docker-library/python.git |
| octolytics-dimension-user_id | 7739233 |
| octolytics-dimension-user_login | docker-library |
| octolytics-dimension-repository_id | 21054928 |
| octolytics-dimension-repository_nwo | docker-library/python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21054928 |
| octolytics-dimension-repository_network_root_nwo | docker-library/python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width