Skip to content

Commit e67dd07

Browse files
authored
Merge pull request #255 from pyenv/workaround-get-pip-url-py26-py32
Use custom get-pip URL based on the target version (pyenv/pyenv#1127)
2 parents 051cd58 + 077edc3 commit e67dd07

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

bin/pyenv-virtualenv

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,28 @@ if [ -z "${EZ_SETUP_URL}" ]; then
459459
fi
460460
if [ -z "${GET_PIP_URL}" ]; then
461461
if [ -n "${PIP_VERSION}" ]; then
462+
{ colorize 1 "WARNING"
463+
echo ": Setting PIP_VERSION=${PIP_VERSION} is no longer supported and may cause failures during the install process."
464+
} 1>&2
462465
GET_PIP_URL="https://raw.githubusercontent.com/pypa/pip/${PIP_VERSION}/contrib/get-pip.py"
463466
# Unset `PIP_VERSION` from environment before invoking `get-pip.py` to deal with "ValueError: invalid truth value" (pypa/pip#4528)
464467
unset PIP_VERSION
465468
else
466-
GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py"
469+
# Use custom get-pip URL based on the target version (#1127)
470+
case "${PYENV_VERSION}" in
471+
2.6 | 2.6.* )
472+
GET_PIP_URL="https://bootstrap.pypa.io/2.6/get-pip.py"
473+
;;
474+
3.2 | 3.2.* )
475+
GET_PIP_URL="https://bootstrap.pypa.io/3.2/get-pip.py"
476+
;;
477+
3.3 | 3.3.* )
478+
GET_PIP_URL="https://bootstrap.pypa.io/3.3/get-pip.py"
479+
;;
480+
* )
481+
GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py"
482+
;;
483+
esac
467484
fi
468485
fi
469486

test/pip.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ OUT
6363
assert_success
6464
assert_output <<OUT
6565
PYENV_VERSION=3.3.6 python -m venv ${PYENV_ROOT}/versions/3.3.6/envs/venv
66-
Installing pip from https://bootstrap.pypa.io/get-pip.py...
66+
Installing pip from https://bootstrap.pypa.io/3.3/get-pip.py...
6767
PYENV_VERSION=3.3.6/envs/venv python -s ${TMP}/pyenv/cache/get-pip.py
6868
rehashed
6969
OUT

0 commit comments

Comments
 (0)