@@ -10,16 +10,11 @@ set -e
1010# subsequent actions in the current job, and not the current action.
1111export 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.
1814python3 -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
2318python3 -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)
3328python3 -m pip install --user poetry! =1.0.10
3429python3 -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