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 575
575
# simply use our pip to install self. Kinda crazy, but it works!
576
576
577
577
${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
579
584
580
585
# Hack up the system configuration settings to aid portability.
581
586
#
Original file line number Diff line number Diff line change 19
19
20
20
from pythonbuild .cpython import (
21
21
STDLIB_TEST_PACKAGES ,
22
+ meets_python_maximum_version ,
22
23
meets_python_minimum_version ,
23
24
parse_config_c ,
24
25
)
@@ -1653,19 +1654,22 @@ def build_cpython(
1653
1654
pip_env ,
1654
1655
)
1655
1656
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
+ )
1669
1673
1670
1674
# The executables in the Scripts/ directory don't work because they reference
1671
1675
# 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
259
259
Python installations have some additional software pre-installed:
260
260
261
261
* `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)
263
263
264
264
The intent of the pre-installed software is to facilitate end-user
265
265
package installation without having to first bootstrap a packaging
You can’t perform that action at this time.
0 commit comments