diff --git a/bin/compile b/bin/compile index 1bd3cd36b..049103175 100755 --- a/bin/compile +++ b/bin/compile @@ -172,7 +172,7 @@ python::install "${BUILD_DIR}" "${STACK}" "${python_full_version}" "${python_maj package_manager_install_start_time=$(build_data::current_unix_realtime) case "${package_manager}" in pip) - pip::install_pip_setuptools_wheel "${python_home}" "${python_major_version}" + pip::install_pip "${python_home}" "${python_major_version}" ;; pipenv) pipenv::install_pipenv "${python_home}" "${python_major_version}" "${EXPORT_PATH}" "${PROFILE_PATH}" diff --git a/lib/pip.sh b/lib/pip.sh index 147c5f1ba..8c85647b6 100644 --- a/lib/pip.sh +++ b/lib/pip.sh @@ -8,15 +8,10 @@ PIP_VERSION=$(utils::get_requirement_version 'pip') SETUPTOOLS_VERSION=$(utils::get_requirement_version 'setuptools') WHEEL_VERSION=$(utils::get_requirement_version 'wheel') -function pip::install_pip_setuptools_wheel() { +function pip::install_pip() { local python_home="${1}" local python_major_version="${2}" - # We use the pip wheel bundled within Python's standard library to install our chosen - # pip version, since it's faster than `ensurepip` followed by an upgrade in place. - local bundled_pip_module_path - bundled_pip_module_path="$(utils::bundled_pip_module_path "${python_home}" "${python_major_version}")" - build_data::set_string "pip_version" "${PIP_VERSION}" local packages_to_install=( @@ -46,6 +41,11 @@ function pip::install_pip_setuptools_wheel() { # app's requirements.txt in the last build). The install will be a no-op if the versions match. output::step "Installing ${packages_display_text}" + # We use the pip wheel bundled within Python's standard library to install our chosen + # pip version, since it's faster than `ensurepip` followed by an upgrade in place. + local bundled_pip_module_path + bundled_pip_module_path="$(utils::bundled_pip_module_path "${python_home}" "${python_major_version}")" + # `--isolated`: Prevents any custom pip configuration added by third party buildpacks (via env # vars or global config files) from breaking package manager bootstrapping. # shellcheck disable=SC2310 # This function is invoked in an 'if' condition so set -e will be disabled.