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

Fix caching of editable VCS Pipenv dependencies #1528

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Jan 5, 2024

When installing a VCS dependency in editable mode, the source repository has to be git cloned somewhere, and that location referenced via a .pth file added to site-packages.

Previously, when using Pipenv the default source repository location was used, which is a src/ directory inside the current working directory. ie: /app/src/.

However, this directory is not preserved/cached across builds, meaning that on the next Pipenv install the repository has to be cloned from scratch.

Now, the source repository location when using Pipenv has been overridden to /app/.heroku/src/, which is cached, and matches the location used for Pip projects. This is configured via Pipenv's --extra-pip-args feature:
https://pipenv.pypa.io/en/latest/advanced.html#supplying-additional-arguments-to-pip

Lastly, the standard Pip install invocation args have been tweaked to consistently use quotes and the absolute path.

Fixes #1527.
GUS-W-14764812.

@edmorley edmorley added the bug label Jan 5, 2024
@edmorley edmorley self-assigned this Jan 5, 2024
@edmorley edmorley force-pushed the fix-editable-vcs-repo-caching branch from 5da5e0b to d9848ae Compare January 5, 2024 21:27
@edmorley edmorley marked this pull request as ready for review January 5, 2024 21:29
@edmorley edmorley requested a review from a team as a code owner January 5, 2024 21:29
@edmorley edmorley force-pushed the fix-editable-vcs-repo-caching branch from d9848ae to d4d1b52 Compare January 5, 2024 21:30
@edmorley edmorley enabled auto-merge (squash) January 5, 2024 21:32
@edmorley edmorley disabled auto-merge January 6, 2024 11:46
@edmorley edmorley force-pushed the fix-editable-vcs-repo-caching branch from d4d1b52 to a55da95 Compare January 6, 2024 11:53
@edmorley edmorley enabled auto-merge (squash) January 6, 2024 11:54
When installing a VCS dependency in editable mode, the source repository
has to be git cloned somewhere, and that location referenced via a `.pth`
file added to `site-packages`.

Previously, when using Pipenv the default source repository location was used,
which is a `src/` directory inside the current working directory. ie: `/app/src/`.

However, this directory is not preserved/cached across builds, meaning that
on the next Pipenv install the repository has to be cloned from scratch.

Now, the source repository location when using Pipenv has been overridden
to `/app/.heroku/src/`, which is cached, and matches the location used for
Pip projects. This is configured via Pipenv's `--extra-pip-args` feature:
https://pipenv.pypa.io/en/latest/advanced.html#supplying-additional-arguments-to-pip

Lastly, the standard Pip install invocation args have been tweaked to consistently
use quotes and the absolute path.

Fixes #1527.
GUS-W-14764812.
@edmorley edmorley force-pushed the fix-editable-vcs-repo-caching branch from a55da95 to a7e9f12 Compare January 6, 2024 12:05
@edmorley edmorley disabled auto-merge January 6, 2024 12:07
@edmorley edmorley enabled auto-merge (squash) January 6, 2024 12:07
@edmorley edmorley merged commit 3e59c28 into main Jan 6, 2024
4 checks passed
@edmorley edmorley deleted the fix-editable-vcs-repo-caching branch January 6, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source repos for editable Pipenv VCS installs are not cached between builds
2 participants