Skip to content

Commit e7bb05d

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "install_pip: Use packaged pip on Fedora"
2 parents ca3407c + a209718 commit e7bb05d

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

tools/install_pip.sh

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,31 @@ if [[ -n $PYPI_ALTERNATIVE_URL ]]; then
126126
configure_pypi_alternative_url
127127
fi
128128

129-
# Eradicate any and all system packages
130-
131-
# Python in fedora/suse depends on the python-pip package so removing it
132-
# results in a nonfunctional system. pip on fedora installs to /usr so pip
133-
# can safely override the system pip for all versions of fedora
134-
if ! is_fedora && ! is_suse; then
129+
if is_fedora && [[ ${DISTRO} == f* ]]; then
130+
# get-pip.py will not install over the python3-pip package in
131+
# Fedora 34 any more.
132+
# https://bugzilla.redhat.com/show_bug.cgi?id=1988935
133+
# https://github.com/pypa/pip/issues/9904
134+
# You can still install using get-pip.py if python3-pip is *not*
135+
# installed; this *should* remain separate under /usr/local and not break
136+
# if python3-pip is later installed.
137+
# For general sanity, we just use the packaged pip. It should be
138+
# recent enough anyway.
139+
install_package python3-pip
140+
elif is_fedora || is_suse; then
141+
# Python in suse/centos depends on the python-pip package; because
142+
# of the split "system-python" uninstalling python3-pip also
143+
# uninstalls the user python3 package which is bad and leaves us
144+
# without a python to use. Just install over.
145+
install_get_pip
146+
else
147+
# Remove packaged pip, and install the latest upstream.
135148
if is_package_installed python3-pip ; then
136149
uninstall_package python3-pip
137150
fi
151+
install_get_pip
138152
fi
139153

140-
install_get_pip
141-
142154
set -x
143155

144156
# Note setuptools is part of requirements.txt and we want to make sure

0 commit comments

Comments
 (0)