Skip to content

Commit

Permalink
Install at least pip version 19.1.1
Browse files Browse the repository at this point in the history
This is to avoid a known issue with a recent version of cryptography [1]

[1] pyca/cryptography#5771

Change-Id: I034bcd24031b5881ae49b8bc03bed6654cd1d335
  • Loading branch information
elfosardo committed Feb 9, 2021
1 parent ea0015c commit 5360d0e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ fi

declare -A PKG_MAP

# NOTE(rpittau): we need a stable recent version of pip to avoid issues with
# the cryptography package.
PIP_MIN_REQ="19.1.1"
PIP_TUPLE="(19, 1, 1)"

# workaround: for latest bindep to work, it needs to use en_US local
export LANG=en_US.UTF-8

Expand Down Expand Up @@ -86,7 +91,7 @@ case ${ID,,} in
*) echo "ERROR: Supported package manager not found. Supported: apt, dnf, yum, zypper"; exit 1;;
esac

echo Installing Python and PIP
echo "Installing Python and PIP"

for pkg in ${CHECK_CMD_PKGS[@]}; do
if ! $(${CHECK_CMD} ${PKG_MAP[$pkg]} &>/dev/null); then
Expand Down Expand Up @@ -133,11 +138,12 @@ if [[ "${BIFROST_TRACE:-}" != true ]]; then
PIP="$PIP --quiet"
fi

$PYTHON << EOF
import pip
version = tuple(map(int, pip.__version__.split('.')))
assert version >= (7, 1)
EOF
# NOTE(rpittau): we need a stable recent version of pip to avoid issues with
# the cryptography package.
PIP_REQUIRED=$($PYTHON -c "import pip; print(tuple(map(int, pip.__version__.split('.'))) >= $PIP_TUPLE)")
if [[ $PIP_REQUIRED == "False" ]]; then
${PIP} install "pip==$PIP_MIN_REQ"
fi

export PIP_OPTS="--upgrade-strategy only-if-needed"

Expand Down

0 comments on commit 5360d0e

Please sign in to comment.