From af84e36d8e14d0e0475d8dc1d705ca0d88e21378 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Mon, 27 Dec 2021 12:06:22 +0300 Subject: [PATCH] ipatests: azure: Use distro's setuptools setuptools 60+ switched to bundled version of distutils (stdlib's one will be removed in the future): https://github.com/pypa/setuptools/pull/2143 https://github.com/pypa/packaging-problems/issues/127 ALT patches stdlib's version of distutils but not the setuptools's one yet. For example, if the system's setuptools replace distutils with its bundled one but the virtualenv's setuptools (bundled wheel) doesn't do it (for example, setuptools < 60), then the behaviour will be inconsistent: ``` [builder@localhost freeipa-4.9.8]$ python3 -c "import distutils.sysconfig;print(distutils.sysconfig.get_python_lib(prefix='/usr'))" /usr/lib/python3.9/site-packages ``` ``` [builder@localhost freeipa-4.9.8]$ export SETUPTOOLS_USE_DISTUTILS=stdlib [builder@localhost freeipa-4.9.8]$ python3 -c "import distutils.sysconfig;print(distutils.sysconfig.get_python_lib(prefix='/usr'))" /usr/lib/python3/site-packages ``` This happens in FreeIPA CI: ``` [1394] /__w/1/s$ /__w/1/s/.tox-install.sh wheel_bundle .tox/pylint3/bin/python /__w/1/s/.tox/pylint3/lib/python3.9/site-packages 'ipaclient[otptoken_yubikey,ldap]' pylint + FLAVOR=wheel_bundle ++ realpath -s .tox/pylint3/bin/python + ENVPYTHON=/__w/1/s/.tox/pylint3/bin/python ++ realpath -s /__w/1/s/.tox/pylint3/lib/python3.9/site-packages + ENVSITEPACKAGESDIR=/__w/1/s/.tox/pylint3/lib/python3.9/site-packages + shift 3 +++ dirname /__w/1/s/.tox-install.sh ++ cd /__w/1/s ++ pwd + TOXINIDIR=/__w/1/s + '[' '!' -x /__w/1/s/.tox/pylint3/bin/python ']' + '[' '!' -d /__w/1/s/.tox/pylint3/lib/python3.9/site-packages ']' + echo '/__w/1/s/.tox/pylint3/lib/python3.9/site-packages: no such directory' /__w/1/s/.tox/pylint3/lib/python3.9/site-packages: no such directory + exit 2 ERROR: invocation failed (exit code 2) ``` --- .github/workflows/scripts/prepare-tox-altlinux.sh | 2 +- ipatests/azure/templates/prepare-tox-altlinux.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/prepare-tox-altlinux.sh b/.github/workflows/scripts/prepare-tox-altlinux.sh index 38adb303d1a..b383765b515 100755 --- a/.github/workflows/scripts/prepare-tox-altlinux.sh +++ b/.github/workflows/scripts/prepare-tox-altlinux.sh @@ -3,5 +3,5 @@ function prepare_tox() { apt-get install -y nss-tools python3-module-pip runuser -u "$GHA_USER" -- \ - python3 -m pip install --user --upgrade pip setuptools pycodestyle + python3 -m pip install --user --upgrade pip pycodestyle } diff --git a/ipatests/azure/templates/prepare-tox-altlinux.yml b/ipatests/azure/templates/prepare-tox-altlinux.yml index c6bda41219e..288572ba239 100644 --- a/ipatests/azure/templates/prepare-tox-altlinux.yml +++ b/ipatests/azure/templates/prepare-tox-altlinux.yml @@ -2,5 +2,5 @@ steps: - script: | set -e sudo apt-get install -y nss-tools python3-module-pip - python3 -m pip install --user --upgrade pip setuptools pycodestyle + python3 -m pip install --user --upgrade pip pycodestyle displayName: Install Tox prerequisites