Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only set PIP_PYTHON at build time #307

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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