From d78a2252854c611fd01549287a12143260277917 Mon Sep 17 00:00:00 2001 From: Craig Silverstein Date: Fri, 12 Feb 2021 08:34:11 -0800 Subject: [PATCH] Make sure we are using an old version of pip on our dev machines. Summary: pip20+ stopped supporting python2.7. We need to make sure we are using an older pip. Issue: https://khanacademy.slack.com/archives/C8Y4Q1E0J/p1613103475175600 Test Plan: I ran if ! pip --version | grep -q "pip 1[0-9]"; then pip install -U "pip<20" setuptools; fi manually in my shell twice. The first time it successfully installed something, the second time was a noop. Reviewers: #devops, davidbraley Reviewed By: #devops, davidbraley Differential Revision: https://phabricator.khanacademy.org/D69259 --- shared-functions.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared-functions.sh b/shared-functions.sh index 0041fb4..da1cd88 100644 --- a/shared-functions.sh +++ b/shared-functions.sh @@ -163,6 +163,12 @@ create_and_activate_virtualenv() { # Activate the virtualenv. . "$1/bin/activate" + + # pip20+ stopped supporting python2.7, so we need to make sure + # we are using an older pip. + if ! pip --version | grep -q "pip 1[0-9]"; then + pip install -U "pip<20" setuptools + fi } # If we exit unexpectedly, log this warning.