Changeset View
Changeset View
Standalone View
Standalone View
docker/utils/pyutils.sh
#!/bin/bash | #!/bin/bash | ||||
setup_pip () { | setup_pip () { | ||||
echo Using pip from $(which pip) | echo Using pip from $(which pip) | ||||
if [[ -d /src ]] ; then | if [[ -d /src ]] ; then | ||||
tmpdir=`mktemp -d` | tmpdir=`mktemp -d` | ||||
pushd /src | pushd /src | ||||
for srcrepo in swh-* ; do | for srcrepo in swh-* ; do | ||||
if [ -w $srcrepo ] | if [ -w $srcrepo ] | ||||
then | then | ||||
# Install package in editable mode if source directory is writable | # Install package in editable mode if source directory is writable | ||||
pip install -e $srcrepo | pip install -e $srcrepo --no-use-pep517 | ||||
anlambert: I already tested that pip option and it will fail to install `swh-search` as `tree_sitter` uses… | |||||
ardumontAuthorUnsubmitted Done Inline ActionsRight, your remark reminds me that you already told me that... i had forgotten. So the solution is within the dockerfile. I did try an early fix on the Dockerfile which worked. Dropping the --upgrade pip in ardumont: Right, your remark reminds me that you already told me that... i had forgotten.
So the… | |||||
anlambertUnsubmitted Not Done Inline ActionsI would rather blacklist the 21.3 release when upgrading: pip install --upgrade 'pip!=21.3'. anlambert: I would rather blacklist the 21.3 release when upgrading: `pip install --upgrade 'pip!=21.3'`. | |||||
ardumontAuthorUnsubmitted Done Inline Actionsack, i'll try that one. ardumont: ack, i'll try that one. | |||||
ardumontAuthorUnsubmitted Done Inline ActionsThanks, that works. A small warning explained it did as we asked, great. WARNING: You are using pip version 21.2.4; however, version 21.3 is available. You should consider upgrading via the '/srv/softwareheritage/venv/bin/python3 -m pip install --upgrade pip' command. ardumont: Thanks, that works.
A small warning explained it did as we asked, great.
```
WARNING: You are… | |||||
# The flag is a workaround for a pip issue | |||||
# https://github.com/pypa/pip/issues/10573#issuecomment-941136050 | |||||
else | else | ||||
# Source directories might not be writeable, but building them writes | # Source directories might not be writeable, but building them writes | ||||
# in-tree; so we're copying them to a location guaranteed to be writeable. | # in-tree; so we're copying them to a location guaranteed to be writeable. | ||||
rsync -a --chmod=+w $srcrepo $tmpdir/ --exclude "*/__pycache__/" --exclude "*/.tox/" --exclude "*/.hypothesis/" | rsync -a --chmod=+w $srcrepo $tmpdir/ --exclude "*/__pycache__/" --exclude "*/.tox/" --exclude "*/.hypothesis/" | ||||
pip install $tmpdir/$srcrepo | pip install $tmpdir/$srcrepo | ||||
fi | fi | ||||
done | done | ||||
popd | popd | ||||
rm -rf $tmpdir | rm -rf $tmpdir | ||||
fi | fi | ||||
echo Installed Python packages: | echo Installed Python packages: | ||||
pip list | pip list | ||||
} | } |
I already tested that pip option and it will fail to install swh-search as tree_sitter uses PEP-517 in its setup.py.
The only solution is to force installation of pip != 21.3 in Dockerfile.