Skip to content

Commit

Permalink
Only set PIP_PYTHON at build time (#307)
Browse files Browse the repository at this point in the history
Since it's not needed at run time after #264.

GUS-W-17444427.
  • Loading branch information
edmorley authored Dec 16, 2024
1 parent a531f74 commit b82a2a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions src/layers/pip_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/pip_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b82a2a7

Please sign in to comment.