Skip to content

Commit

Permalink
ipatests: azure: Use distro's setuptools
Browse files Browse the repository at this point in the history
setuptools 60+ switched to bundled version of distutils
(stdlib's one will be removed in the future):
pypa/setuptools#2143
pypa/packaging-problems#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)
```
  • Loading branch information
stanislavlevin committed Jan 10, 2024
1 parent a29c1b0 commit af84e36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scripts/prepare-tox-altlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion ipatests/azure/templates/prepare-tox-altlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit af84e36

Please sign in to comment.