Skip to content

Commit 8cbc02a

Browse files
authored
Merge pull request #339 from github/split-python2-python3-install
Install Python 3 tools before installing Python 2 tools.
2 parents 6821589 + 222b57e commit 8cbc02a

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

python-setup/install_tools.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,11 @@ set -e
1010
# subsequent actions in the current job, and not the current action.
1111
export PATH="$HOME/.local/bin:$PATH"
1212

13-
# The Ubuntu 20.04 GHA environment does not come with a Python 2 pip
14-
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
15-
python2 get-pip.py
16-
17-
python2 -m pip install --user --upgrade pip setuptools wheel
13+
# Setup Python 3 dependency installation tools.
1814
python3 -m pip install --user --upgrade pip setuptools wheel
1915

2016
# virtualenv is a bit nicer for setting up virtual environment, since it will provide up-to-date versions of
2117
# pip/setuptools/wheel which basic `python3 -m venv venv` won't
22-
python2 -m pip install --user virtualenv
2318
python3 -m pip install --user virtualenv
2419

2520
# We install poetry with pip instead of the recommended way, since the recommended way
@@ -32,3 +27,14 @@ python3 -m pip install --user virtualenv
3227
# poetry 1.0.10 has error (https://github.com/python-poetry/poetry/issues/2711)
3328
python3 -m pip install --user poetry!=1.0.10
3429
python3 -m pip install --user pipenv
30+
31+
if command -v python2 &> /dev/null; then
32+
# Setup Python 2 dependency installation tools.
33+
# The Ubuntu 20.04 GHA environment does not come with a Python 2 pip
34+
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
35+
python2 get-pip.py
36+
37+
python2 -m pip install --user --upgrade pip setuptools wheel
38+
39+
python2 -m pip install --user virtualenv
40+
fi

0 commit comments

Comments
 (0)