python-setup: Fix venv creation in Ubuntu 22.04
Fixes https://github.com/github/codeql-action/issues/1249
This commit is contained in:
parent
aaca8193b1
commit
e1ce6e3115
2 changed files with 14 additions and 4 deletions
|
|
@ -1,7 +1,11 @@
|
||||||
#! /usr/bin/pwsh
|
#! /usr/bin/pwsh
|
||||||
|
|
||||||
py -2 -m pip install --user --upgrade pip setuptools wheel
|
# while waiting for the next release of `virtualenv` after v20.16.5, we install an older
|
||||||
py -3 -m pip install --user --upgrade pip setuptools wheel
|
# version of `setuptools` to ensure that binaries are always put under
|
||||||
|
# `<venv-path>/bin`, which wouldn't always happen with the GitHub actions version of
|
||||||
|
# Ubuntu 22.04. See https://github.com/github/codeql-action/issues/1249
|
||||||
|
py -2 -m pip install --user --upgrade pip 'setuptools<60' wheel
|
||||||
|
py -3 -m pip install --user --upgrade pip 'setuptools<60' wheel
|
||||||
|
|
||||||
# virtualenv is a bit nicer for setting up virtual environment, since it will provide up-to-date versions of
|
# virtualenv is a bit nicer for setting up virtual environment, since it will provide up-to-date versions of
|
||||||
# pip/setuptools/wheel which basic `python3 -m venv venv` won't
|
# pip/setuptools/wheel which basic `python3 -m venv venv` won't
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,13 @@ set -e
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
# Setup Python 3 dependency installation tools.
|
# Setup Python 3 dependency installation tools.
|
||||||
python3 -m pip install --user --upgrade pip setuptools wheel
|
|
||||||
|
# we install an older version of `setuptools` to ensure that binaries are always put
|
||||||
|
# under `<venv-path>/bin`, which wouldn't always happen with the GitHub actions version
|
||||||
|
# of Ubuntu 22.04. See https://github.com/github/codeql-action/issues/1249. The the next
|
||||||
|
# release of `virtualenv` after v20.16.5 will include a fix for this, so we can remove
|
||||||
|
# this bit of the logic again.
|
||||||
|
python3 -m pip install --user --upgrade pip 'setuptools<60' wheel
|
||||||
|
|
||||||
# virtualenv is a bit nicer for setting up virtual environment, since it will provide up-to-date versions of
|
# virtualenv is a bit nicer for setting up virtual environment, since it will provide up-to-date versions of
|
||||||
# pip/setuptools/wheel which basic `python3 -m venv venv` won't
|
# pip/setuptools/wheel which basic `python3 -m venv venv` won't
|
||||||
|
|
@ -40,7 +46,7 @@ if command -v python2 >/dev/null 2>&1; then
|
||||||
curl --location --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2
|
curl --location --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python2 -m pip install --user --upgrade pip setuptools wheel
|
python2 -m pip install --user --upgrade pip 'setuptools<60' wheel
|
||||||
|
|
||||||
python2 -m pip install --user 'virtualenv<20.11'
|
python2 -m pip install --user 'virtualenv<20.11'
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue