pip-and-virtualenv: drop f31 & tumbleweed, rework suse 15 install

This is an alternative approach to commit
68bb43535e.  I think this proposes a
better overall solution that the prior change which had the Python 3
packages being installed, but did not specify the _do_py3 flag to do
the installation steps that redirect the various tool installations.

Fedora 31+ doesn't have python2, and Tumbleweed does have some Python
2 support but there seems to be no reason to bother updating this
element for either with infra very close to removing this completely
[1].  Error out on these platforms, and add a release note.

The 15 path should include the python2 and python3 packages, along
with the flags to do the "cleanup"; i.e. forced removal of distutils
packages that pip 10+ won't touch.  As mentioned in the original
change, the six package causes problems here, but we can clear that
too by explicitly listing it instead of letting it come in via
dependencies.  Again, this element will be removed from the infra 15
builds ASAP; but we can release with this to provide a roll-back point
if we need to revert the removal to fix things temporarily.

Add it to the testing path as well.

[1] https://docs.opendev.org/opendev/infra-specs/latest/specs/cleanup-test-node-python.html

Change-Id: I7a6a342461d6001c25e55638ba9b7438c28f2519
This commit is contained in:
Ian Wienand 2020-04-22 11:08:19 +10:00
parent b262e88443
commit ac7fba7040
4 changed files with 25 additions and 10 deletions

View File

@ -132,6 +132,10 @@
Run the default tests on a Xenial build host with Python 3
parent: dib-functests-default
nodeset: ubuntu-xenial
vars:
dib_functests_extra:
# Only builds on xenial; should work on focal in future
- pip-and-virtualenv/source-install-opensuse
- job:
name: dib-functests-xenial-python3-image

View File

@ -6,6 +6,4 @@ fi
set -eu
set -o pipefail
for f in $(find $(dirname $0)/../bin/ -type f -executable -print); do
install -m 0755 -o root -g root $f /usr/local/bin
done
install -m 0755 -o root -g root $(dirname $0)/../bin/* /usr/local/bin

View File

@ -29,6 +29,10 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then
_clear_old_files=1
;;
fedora)
if [[ ${DIB_RELEASE} -gt 30 ]]; then
echo "This element is not supported for this version of Fedora"
exit 1
fi
_do_py3=1
packages="python2-virtualenv python2-pip python2-setuptools"
packages=" python3-virtualenv python3-pip python3-setuptools"
@ -60,14 +64,17 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then
_clear_old_files=1
;;
15*)
# XXX: python3?
packages="python-xml python"
packages+=" python3-virtualenv python3-pip python3-setuptools"
_do_py3=1
_clear_old_files=1
# python*-six gets dragged in, and then is a
# distutils package and won't uninstall. put it
# here so it gets cleaned.
packages="python2-virtualenv python2-pip python2-setuptools python2-six"
packages+=" python3-virtualenv python3-pip python3-setuptools python3-six"
;;
tumbleweed)
### _do_py3=1
packages="python-xml python"
packages+=" python3-virtualenv python3-pip python3-setuptools"
echo "This element is not supported for this platform"
exit 1
;;
esac
;;
@ -157,7 +164,9 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then
#
# Thus we need to *reinstall* the RPM version now, so those
# files come back and system tools continue to work
dnf reinstall -y python3-setuptools
if [[ $DISTRO_NAME != opensuse ]]; then
dnf reinstall -y python3-setuptools
fi
fi
# now install latest virtualenv. it vendors stuff it needs so

View File

@ -0,0 +1,4 @@
---
upgrade:
- The ``pip-and-virtualenv`` element does not support Fedora 31 (and
greater) or Tumbleweed distributions.