Skip to content

Commit ebc7b0e

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Simplify pip install"
2 parents 5585d84 + 8dac135 commit ebc7b0e

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
@@ -756,7 +756,19 @@ git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
756756
echo_summary "Installing package prerequisites"
757757
source $TOP_DIR/tools/install_prereqs.sh
758758

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