Skip to content

Commit

Permalink
Merge pull request #339 from github/split-python2-python3-install
Browse files Browse the repository at this point in the history
Install Python 3 tools before installing Python 2 tools.
  • Loading branch information
chrisgavin authored Dec 7, 2020
2 parents 6821589 + 222b57e commit 8cbc02a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions python-setup/install_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ set -e
# subsequent actions in the current job, and not the current action.
export PATH="$HOME/.local/bin:$PATH"

# The Ubuntu 20.04 GHA environment does not come with a Python 2 pip
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
python2 get-pip.py

python2 -m pip install --user --upgrade pip setuptools wheel
# Setup Python 3 dependency installation tools.
python3 -m pip install --user --upgrade pip setuptools wheel

# 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
python2 -m pip install --user virtualenv
python3 -m pip install --user virtualenv

# We install poetry with pip instead of the recommended way, since the recommended way
Expand All @@ -32,3 +27,14 @@ python3 -m pip install --user virtualenv
# poetry 1.0.10 has error (https://github.com/python-poetry/poetry/issues/2711)
python3 -m pip install --user poetry!=1.0.10
python3 -m pip install --user pipenv

if command -v python2 &> /dev/null; then
# Setup Python 2 dependency installation tools.
# The Ubuntu 20.04 GHA environment does not come with a Python 2 pip
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
python2 get-pip.py

python2 -m pip install --user --upgrade pip setuptools wheel

python2 -m pip install --user virtualenv
fi

0 comments on commit 8cbc02a

Please sign in to comment.