Skip to content

Stop manually creating a src dir in the pip dependencies layer#228

Merged
edmorley merged 1 commit into
mainfrom
stop-creating-src-dir
Jul 19, 2024
Merged

Stop manually creating a src dir in the pip dependencies layer#228
edmorley merged 1 commit into
mainfrom
stop-creating-src-dir

Conversation

@edmorley
Copy link
Copy Markdown
Member

@edmorley edmorley commented Jul 19, 2024

Since pip will create the directory itself if needed (which is only when there are editable mode VCS dependencies being installed).

This behaviour is already tested, via:

// This tests that:
// - Requirements file env var interpolation works (ie: user-provided env vars have been propagated to pip).
// - Git from the stack image can be found (ie: the system PATH has been correctly propagated to pip).
// - The editable mode repository clone is saved into the dependencies layer not the app dir.
// - Compiling a source distribution package (as opposed to a pre-built wheel) works.
// - The Python headers can be found in the `include/pythonX.Y/` directory of the Python layer.
#[test]
#[ignore = "integration test"]
fn pip_editable_git_compiled() {
TestRunner::default().build(
default_build_config( "tests/fixtures/pip_editable_git_compiled")
.env("WHEEL_PACKAGE_URL", "https://github.com/pypa/wheel"),
|context| {
assert_contains!(
context.pack_stdout,
"Cloning https://github.com/pypa/wheel (to revision 0.40.0) to /layers/heroku_python/dependencies/src/extension-dist"
);
},
);
}

GUS-W-16390558.

Since Pip will create the directory itself if needed (which is only when
there are editable mode VCS dependencies being installed).

This behaviour is already tested, via:
https://github.com/heroku/buildpacks-python/blob/ff51b31c65cbd1932fc4cdc585c60942efcfe836/tests/pip_test.rs#L197-L216
@edmorley edmorley self-assigned this Jul 19, 2024
@edmorley edmorley marked this pull request as ready for review July 19, 2024 14:11
@edmorley edmorley requested a review from a team as a code owner July 19, 2024 14:11
@edmorley edmorley enabled auto-merge (squash) July 19, 2024 14:17
@edmorley edmorley merged commit 2add4a0 into main Jul 19, 2024
@edmorley edmorley deleted the stop-creating-src-dir branch July 19, 2024 14:47
@edmorley edmorley changed the title Stop manually creating a src dir in the Pip dependencies layer Stop manually creating a src dir in the pip dependencies layer Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants