Skip to content

Commit 160613c

Browse files
authored
Merge pull request #1402 from github/rasmuswl/new-virtualenv
python-setup: rely on new `virtualenv` for venv creation in Ubuntu 22.04
2 parents 9dac9f7 + caf1c50 commit 160613c

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

python-setup/install_tools.ps1

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
#! /usr/bin/pwsh
22

3-
# while waiting for the next release of `virtualenv` after v20.16.5, we install an older
4-
# version of `setuptools` to ensure that binaries are always put under
5-
# `<venv-path>/bin`, which wouldn't always happen with the GitHub actions version of
6-
# Ubuntu 22.04. See https://github.com/github/codeql-action/issues/1249
7-
py -2 -m pip install --user --upgrade pip 'setuptools<60' wheel
8-
py -3 -m pip install --user --upgrade pip 'setuptools<60' wheel
3+
py -2 -m pip install --user --upgrade pip setuptools wheel
4+
py -3 -m pip install --user --upgrade pip setuptools wheel
95

106
# virtualenv is a bit nicer for setting up virtual environment, since it will provide up-to-date versions of
117
# pip/setuptools/wheel which basic `python3 -m venv venv` won't

python-setup/install_tools.sh

+9-10
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ export PATH="$HOME/.local/bin:$PATH"
1212

1313
# Setup Python 3 dependency installation tools.
1414

15-
# we install an older version of `setuptools` to ensure that binaries are always put
16-
# under `<venv-path>/bin`, which wouldn't always happen with the GitHub actions version
17-
# of Ubuntu 22.04. See https://github.com/github/codeql-action/issues/1249. The the next
18-
# release of `virtualenv` after v20.16.5 will include a fix for this, so we can remove
19-
# this bit of the logic again.
20-
python3 -m pip install --user --upgrade pip 'setuptools<60' wheel
15+
python3 -m pip install --user --upgrade pip setuptools wheel
2116

22-
# virtualenv is a bit nicer for setting up virtual environment, since it will provide up-to-date versions of
23-
# pip/setuptools/wheel which basic `python3 -m venv venv` won't
24-
python3 -m pip install --user virtualenv
17+
# virtualenv is a bit nicer for setting up virtual environment, since it will provide
18+
# up-to-date versions of pip/setuptools/wheel which basic `python3 -m venv venv` won't.
19+
#
20+
# version 20.16.5 (Python 3 only) had some problems when used together with newer
21+
# versions of setuptools (60+) and would not always put binaries under `<venv-path>/bin`
22+
# -- see https://github.com/github/codeql-action/issues/1249 for more details.
23+
python3 -m pip install --user --upgrade 'virtualenv>20.16.5'
2524

2625
# We install poetry with pip instead of the recommended way, since the recommended way
2726
# caused some problem since `poetry run` gives output like:
@@ -45,7 +44,7 @@ if command -v python2 >/dev/null 2>&1; then
4544
curl --location --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2
4645
fi
4746

48-
python2 -m pip install --user --upgrade pip 'setuptools<60' wheel
47+
python2 -m pip install --user --upgrade pip setuptools wheel
4948

5049
python2 -m pip install --user 'virtualenv!=20.12.0'
5150
fi

0 commit comments

Comments
 (0)