Skip to content

Commit 8dac135

Browse files
committed
Simplify pip install
The uninstall here has been around since Ibb4b42119dc2e51577c77bbbbffb110863e5324d. At the time, there might have been conflicts between packaged and installed pip. We don't need it today; get-pip.py keeps itself separate enough in /usr/local on all platforms. Thus we can also remove the suse/centos special-casing. python3-pip is in the RPM list so we don't need to re-install for Fedora. Add a note on why we are over-installing pip. Remove some old setuptools workarounds that are commented out. Change-Id: Ie3cb81a8ff71cf4b81e23831c380f83b0381de71
1 parent 156ccba commit 8dac135

2 files changed

Lines changed: 15 additions & 21 deletions

File tree

stack.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,19 @@ git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
752752
echo_summary "Installing package prerequisites"
753753
source $TOP_DIR/tools/install_prereqs.sh
754754

755-
# Configure an appropriate Python environment
755+
# Configure an appropriate Python environment.
756+
#
757+
# NOTE(ianw) 2021-08-11 : We install the latest pip here because pip
758+
# is very active and changes are not generally reflected in the LTS
759+
# distros. This often involves important things like dependency or
760+
# conflict resolution, and has often been required because the
761+
# complicated constraints etc. used by openstack have tickled bugs in
762+
# distro versions of pip. We want to find these problems as they
763+
# happen, rather than years later when we try to update our LTS
764+
# distro. Whilst it is clear that global installations of upstream
765+
# pip are less and less common, with virtualenv's being the general
766+
# approach now; there are a lot of devstack plugins that assume a
767+
# global install environment.
756768
if [[ "$OFFLINE" != "True" ]]; then
757769
PYPI_ALTERNATIVE_URL=${PYPI_ALTERNATIVE_URL:-""} $TOP_DIR/tools/install_pip.sh
758770
fi

tools/install_pip.sh

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ function configure_pypi_alternative_url {
111111

112112
}
113113

114-
# Setuptools 8 implements PEP 440, and 8.0.4 adds a warning triggered any time
115-
# pkg_resources inspects the list of installed Python packages if there are
116-
# non-compliant version numbers in the egg-info (for example, from distro
117-
# system packaged Python libraries). This is off by default after 8.2 but can
118-
# be enabled by uncommenting the lines below.
119-
#PYTHONWARNINGS=$PYTHONWARNINGS,always::RuntimeWarning:pkg_resources
120-
#export PYTHONWARNINGS
121-
122114
# Show starting versions
123115
get_versions
124116

@@ -135,19 +127,9 @@ if is_fedora && [[ ${DISTRO} == f* ]]; then
135127
# installed; this *should* remain separate under /usr/local and not break
136128
# if python3-pip is later installed.
137129
# 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
130+
# recent enough anyway. This is included via rpms/general
131+
continue
146132
else
147-
# Remove packaged pip, and install the latest upstream.
148-
if is_package_installed python3-pip ; then
149-
uninstall_package python3-pip
150-
fi
151133
install_get_pip
152134
fi
153135

0 commit comments

Comments
 (0)