|
| 1 | +Backport of Python 3.12's removal of setuptools from ensurepip (gh-95299, |
| 2 | +https://github.com/python/cpython/pull/101039) onto CPython 3.11. |
| 3 | + |
| 4 | +ensurepip is only used to bootstrap pip into hostpython. Without this patch |
| 5 | +it would also install its bundled, unpinned setuptools, which would later |
| 6 | +coexist with the hash-pinned setuptools we install ourselves: pip's |
| 7 | +"--target" mode cannot uninstall, so the stale setuptools-79.0.1.dist-info |
| 8 | +would survive next to the pinned version and which distribution gets picked |
| 9 | +up during the build depends on os.listdir() order, breaking reproducibility. |
| 10 | + |
| 11 | +The now-unreferenced setuptools wheel in Lib/ensurepip/_bundled/ is left in |
| 12 | +the source tree ("patch" cannot delete binary files); it is never installed. |
| 13 | + |
| 14 | +The deleted _SETUPTOOLS_VERSION line changes between CPython 3.11.x releases, |
| 15 | +so this patch is coupled to the CPython version pinned in our hostpython3 |
| 16 | +recipe and must be refreshed together with it. Remove the patch when |
| 17 | +hostpython3 is >= 3.12. |
| 18 | + |
| 19 | +--- a/Lib/ensurepip/__init__.py |
| 20 | ++++ b/Lib/ensurepip/__init__.py |
| 21 | +@@ -9,11 +9,9 @@ |
| 22 | + |
| 23 | + |
| 24 | + __all__ = ["version", "bootstrap"] |
| 25 | +-_PACKAGE_NAMES = ('setuptools', 'pip') |
| 26 | +-_SETUPTOOLS_VERSION = "79.0.1" |
| 27 | ++_PACKAGE_NAMES = ('pip',) |
| 28 | + _PIP_VERSION = "24.0" |
| 29 | + _PROJECTS = [ |
| 30 | +- ("setuptools", _SETUPTOOLS_VERSION, "py3"), |
| 31 | + ("pip", _PIP_VERSION, "py3"), |
| 32 | + ] |
| 33 | + |
0 commit comments