From 980159f2211894c3593a74b16ed8703ec885a72e Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Thu, 29 Mar 2018 00:39:30 +0000 Subject: [PATCH 1/5] Use custom get-pip URL based on the target version (pyenv/pyenv#1127) --- bin/pyenv-virtualenv | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index ff29cfc..326e0b7 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -463,7 +463,21 @@ if [ -z "${GET_PIP_URL}" ]; then # Unset `PIP_VERSION` from environment before invoking `get-pip.py` to deal with "ValueError: invalid truth value" (pypa/pip#4528) unset PIP_VERSION else - GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py" + # Use custom get-pip URL based on the target version (#1127) + case "${DEFINITION_PATH##*/}" in + 2.6 | 2.6.* ) + GET_PIP_URL="https://bootstrap.pypa.io/2.6/get-pip.py" + ;; + 3.2 | 3.2.* ) + GET_PIP_URL="https://bootstrap.pypa.io/3.2/get-pip.py" + ;; + 3.3 | 3.3.* ) + GET_PIP_URL="https://bootstrap.pypa.io/3.3/get-pip.py" + ;; + * ) + GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py" + ;; + esac fi fi From 894d4af8a31d0c38e10efc01dcfe0ff20f356b6a Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Thu, 29 Mar 2018 00:59:01 +0000 Subject: [PATCH 2/5] Show some warning on the use of `PIP_VERSION` --- bin/pyenv-virtualenv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index 326e0b7..a0956c7 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -459,6 +459,9 @@ if [ -z "${EZ_SETUP_URL}" ]; then fi if [ -z "${GET_PIP_URL}" ]; then if [ -n "${PIP_VERSION}" ]; then + { colorize 1 "WARNING" + echo ": pip is going to abandon the support for the custom version installation via custom get-pip URL. The use of PIP_VERSION=${PIP_VERSION} may not work anymore." + } 1>&2 GET_PIP_URL="https://raw.githubusercontent.com/pypa/pip/${PIP_VERSION}/contrib/get-pip.py" # Unset `PIP_VERSION` from environment before invoking `get-pip.py` to deal with "ValueError: invalid truth value" (pypa/pip#4528) unset PIP_VERSION From 6a3172ff47f996e0f4222867505afceed8f47b30 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Thu, 29 Mar 2018 01:01:16 +0000 Subject: [PATCH 3/5] Unlike `python-build`, `DEFINITION_PATH` isn't available within `pyenv-virtualenv` --- bin/pyenv-virtualenv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index a0956c7..3e3aa19 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -467,7 +467,7 @@ if [ -z "${GET_PIP_URL}" ]; then unset PIP_VERSION else # Use custom get-pip URL based on the target version (#1127) - case "${DEFINITION_PATH##*/}" in + case "${PYENV_VERSION}" in 2.6 | 2.6.* ) GET_PIP_URL="https://bootstrap.pypa.io/2.6/get-pip.py" ;; From 0b24ff557e66c41fa94042ca154eef8ecc934284 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Thu, 29 Mar 2018 01:07:48 +0000 Subject: [PATCH 4/5] I should have used custom `GET_PIP_URL` for 3.3 --- test/pip.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pip.bats b/test/pip.bats index 88aa7b7..a4a94fd 100644 --- a/test/pip.bats +++ b/test/pip.bats @@ -63,7 +63,7 @@ OUT assert_success assert_output < Date: Thu, 29 Mar 2018 03:17:49 +0000 Subject: [PATCH 5/5] Update warning message on presence of `PIP_VERSION` --- bin/pyenv-virtualenv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index 3e3aa19..ca3dd41 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -460,7 +460,7 @@ fi if [ -z "${GET_PIP_URL}" ]; then if [ -n "${PIP_VERSION}" ]; then { colorize 1 "WARNING" - echo ": pip is going to abandon the support for the custom version installation via custom get-pip URL. The use of PIP_VERSION=${PIP_VERSION} may not work anymore." + echo ": Setting PIP_VERSION=${PIP_VERSION} is no longer supported and may cause failures during the install process." } 1>&2 GET_PIP_URL="https://raw.githubusercontent.com/pypa/pip/${PIP_VERSION}/contrib/get-pip.py" # Unset `PIP_VERSION` from environment before invoking `get-pip.py` to deal with "ValueError: invalid truth value" (pypa/pip#4528)