Use SETUPTOOLS_USE_DISTUTILS=stdlib for global pip installs

A new setuptools release has changed the way pip installs are done,
see [0]. With this change we switch back to using the distro
method for global pip installs.

Temporarily make grenade jobs non-voting in order to allow this
patch to be backported.

[0] http://lists.openstack.org/pipermail/openstack-discuss/2020-August/016905.html

Change-Id: I5d8aa0e58e0409c54451b51de5eb70ba9a68d849
(cherry picked from commit 18b4251bf4)
(cherry picked from commit 87d1da30a8)
This commit is contained in:
Ian Wienand 2020-08-31 16:22:57 +10:00 committed by Jens Harbott
parent d3198f34e1
commit 1b35581bb0
1 changed files with 7 additions and 1 deletions

View File

@ -247,7 +247,13 @@ function pip_install {
# and we will let pip sort out the install, regardless of
# the package being local or remote.
echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior"
sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8"
# See
# https://github.com/pypa/setuptools/issues/2232
# http://lists.openstack.org/pipermail/openstack-discuss/2020-August/016905.html
# this makes setuptools >=50 use the platform distutils.
# We only want to do this on global pip installs, not if
# installing in a virtualenv
sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8 SETUPTOOLS_USE_DISTUTILS=stdlib "
cmd_pip=$(get_pip_command $PYTHON3_VERSION)
fi
fi