diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 89fda6ef..eccfec18 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -2118,11 +2118,28 @@ if [ -z "${EZ_SETUP_URL}" ]; then fi if [ -z "${GET_PIP_URL}" ]; then if [ -n "${PIP_VERSION}" ]; then + { colorize 1 "WARNING" + 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) 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 diff --git a/plugins/python-build/test/pyenv_ext.bats b/plugins/python-build/test/pyenv_ext.bats index b79ac37a..ae9f72ab 100644 --- a/plugins/python-build/test/pyenv_ext.bats +++ b/plugins/python-build/test/pyenv_ext.bats @@ -92,6 +92,19 @@ resolve_link() { $(type -p greadlink readlink | head -1) "$1" } +run_inline_definition_with_name() { + local definition_name="build-definition" + case "$1" in + "--name="* ) + local definition_name="${1#--name=}" + shift 1 + ;; + esac + local definition="${TMP}/${definition_name}" + cat > "$definition" + run python-build "$definition" "${1:-$INSTALL_ROOT}" +} + @test "apply built-in python patch before building" { cached_tarball "Python-3.6.2" @@ -326,3 +339,43 @@ OUT assert_success assert_output "10.4" } + +@test "use the default EZ_SETUP_URL by default" { + run_inline_definition <