Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-setup: Check if pip is already installed for Python2 #1039

Merged
merged 3 commits into from
May 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions python-setup/install_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ python3 -m pip install --user poetry!=1.0.10
python3 -m pip install --user pipenv

if command -v python2 >/dev/null 2>&1; then
# Setup Python 2 dependency installation tools.
# The Ubuntu 20.04 GHA environment does not come with a Python 2 pip
curl --location --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2
# Setup Python 2 dependency installation tools. The Ubuntu 20.04 GHA environment
# does not come with a Python 2 pip, but if it is already installed, don't try to
# install it again (since that causes problems).
#
# This might seem like a hypothetical situation, but it happens all the time in our
# internal testing where we run the action twice in a row.
if ! python2 -m pip --version; then
adityasharad marked this conversation as resolved.
Show resolved Hide resolved
echo "Will install pip for python2"
curl --location --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2
fi

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

Expand Down