File tree Expand file tree Collapse file tree 3 files changed +24
-15
lines changed
Expand file tree Collapse file tree 3 files changed +24
-15
lines changed Original file line number Diff line number Diff line change 575575# simply use our pip to install self. Kinda crazy, but it works!
576576
577577${BUILD_PYTHON} " ${PIP_WHEEL} /pip" install --prefix=" ${ROOT} /out/python/install" --no-cache-dir --no-index " ${PIP_WHEEL} "
578- ${BUILD_PYTHON} " ${PIP_WHEEL} /pip" install --prefix=" ${ROOT} /out/python/install" --no-cache-dir --no-index " ${SETUPTOOLS_WHEEL} "
578+
579+ # Setuptools is only installed for Python 3.11 and older, for parity with
580+ # `ensurepip` and `venv`: https://github.com/python/cpython/pull/101039
581+ if [ -n " ${PYTHON_MEETS_MAXIMUM_VERSION_3_11} " ]; then
582+ ${BUILD_PYTHON} " ${PIP_WHEEL} /pip" install --prefix=" ${ROOT} /out/python/install" --no-cache-dir --no-index " ${SETUPTOOLS_WHEEL} "
583+ fi
579584
580585# Hack up the system configuration settings to aid portability.
581586#
Original file line number Diff line number Diff line change 1919
2020from pythonbuild .cpython import (
2121 STDLIB_TEST_PACKAGES ,
22+ meets_python_maximum_version ,
2223 meets_python_minimum_version ,
2324 parse_config_c ,
2425)
@@ -1653,19 +1654,22 @@ def build_cpython(
16531654 pip_env ,
16541655 )
16551656
1656- exec_and_log (
1657- [
1658- str (install_dir / "python.exe" ),
1659- "-m" ,
1660- "pip" ,
1661- "install" ,
1662- "--no-cache-dir" ,
1663- "--no-index" ,
1664- str (setuptools_wheel ),
1665- ],
1666- td ,
1667- pip_env ,
1668- )
1657+ # Setuptools is only installed for Python 3.11 and older, for parity with
1658+ # `ensurepip` and `venv`: https://github.com/python/cpython/pull/101039
1659+ if meets_python_maximum_version (python_version , "3.11" ):
1660+ exec_and_log (
1661+ [
1662+ str (install_dir / "python.exe" ),
1663+ "-m" ,
1664+ "pip" ,
1665+ "install" ,
1666+ "--no-cache-dir" ,
1667+ "--no-index" ,
1668+ str (setuptools_wheel ),
1669+ ],
1670+ td ,
1671+ pip_env ,
1672+ )
16691673
16701674 # The executables in the Scripts/ directory don't work because they reference
16711675 # python.dll in the wrong path. You can run these via e.g. `python.exe -m pip`.
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ Extra Python Software
259259Python installations have some additional software pre-installed:
260260
261261* `pip <https://pypi.org/project/pip/ >`_
262- * `setuptools <https://pypi.org/project/setuptools/ >`_
262+ * `setuptools <https://pypi.org/project/setuptools/ >`_ (for Python 3.11 and older)
263263
264264The intent of the pre-installed software is to facilitate end-user
265265package installation without having to first bootstrap a packaging
You can’t perform that action at this time.
0 commit comments