diff --git a/CHANGELOG.md b/CHANGELOG.md index 511d947..1f67003 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- The `PIP_PYTHON` env var is now only set at build time. ([#307](https://github.com/heroku/buildpacks-python/pull/307)) + ### Removed - Stopped setting the `LANG` env var. ([#306](https://github.com/heroku/buildpacks-python/pull/306)) diff --git a/src/layers/pip_dependencies.rs b/src/layers/pip_dependencies.rs index e7f8055..df82de8 100644 --- a/src/layers/pip_dependencies.rs +++ b/src/layers/pip_dependencies.rs @@ -54,11 +54,11 @@ pub(crate) fn install_dependencies( .map_err(PipDependenciesLayerError::CreateVenvCommand)?; let mut layer_env = LayerEnv::new() - // Since pip is installed in a different layer (outside of this venv), we have to explicitly - // tell it to perform operations against this venv instead of the global Python install. + // pip is installed in a separate build-only layer, we have to explicitly tell it to + // perform operations against this venv instead of the global Python install. // https://pip.pypa.io/en/stable/cli/pip/#cmdoption-python .chainable_insert( - Scope::All, + Scope::Build, ModificationBehavior::Override, "PIP_PYTHON", &layer_path, diff --git a/tests/pip_test.rs b/tests/pip_test.rs index 5f8b712..00e5dc0 100644 --- a/tests/pip_test.rs +++ b/tests/pip_test.rs @@ -85,7 +85,6 @@ fn pip_basic_install_and_cache_reuse() { formatdoc! {" LD_LIBRARY_PATH=/layers/heroku_python/venv/lib:/layers/heroku_python/python/lib PATH=/layers/heroku_python/venv/bin:/layers/heroku_python/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - PIP_PYTHON=/layers/heroku_python/venv PYTHONHOME=/layers/heroku_python/python PYTHONUNBUFFERED=1 VIRTUAL_ENV=/layers/heroku_python/venv