Use -I with ensurepip

The -s flag assures that nothing can be installed to user site-packages
but doesn't keep ensurepip from looking there for Pip.
If Pip is installed in the user site-packages directory, pip won't be installed
for the newly built python -- and its shim won't be created.
-I makes the build install Pip in any case.
The user site-packages installation will override it --
but we'll have the shim at least.
This commit is contained in:
Evan Pitstick 2023-08-25 08:06:08 +03:00 committed by Ivan Pozdeev
parent 8aabba9485
commit 6be6231444
2 changed files with 3 additions and 3 deletions

View file

@ -2025,7 +2025,7 @@ build_package_ensurepip() {
ensurepip_opts="--altinstall"
fi
# FIXME: `--altinstall` with `get-pip.py`
"$PYTHON_BIN" -s -m ensurepip ${ensurepip_opts} 1>/dev/null 2>&1 || build_package_get_pip "$@" || return 1
"$PYTHON_BIN" -I -m ensurepip ${ensurepip_opts} 1>/dev/null 2>&1 || build_package_get_pip "$@" || return 1
build_package_symlink_version_suffix
}

View file

@ -200,7 +200,7 @@ OUT
assert_success
assert_build_log <<OUT
python -s -m ensurepip
python -I -m ensurepip
OUT
}
@ -218,7 +218,7 @@ OUT
assert_success
assert_build_log <<OUT
python -s -m ensurepip --altinstall
python -I -m ensurepip --altinstall
OUT
}