Skip to content

Rewrite editable VCS paths at build time too #1756

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

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Feb 21, 2025

Heroku builds occur at a different path to which the app will be run at run-time. As such, we have to perform path rewriting for editable dependencies, so that they work after relocation.

The existing rewriting is performed at app boot (see code comment for more details), and works fine with pip and Poetry.

However, I discovered that Pipenv doesn't correctly reinstall editable VCS dependencies if they use the new PEP660 style editable interface, which I've reported upstream here:
pypa/pipenv#6348

This issue has affected apps using editable VCS dependencies with Pipenv for some time, but until now only at build-time for cached builds.

However, after #1753 (which thankfully isn't yet released, due to me catching this as part of updating the tests to exercise the new PEP660 style editable interface) would otherwise affect apps at run-time too.

As a workaround, we can perform build time rewriting of paths too, but must do so only for VCS dependencies (see code comment for why).

Lastly, the Pipenv bug also requires that we perform explicit cache invalidation for Pipenv apps after the src dir move in #1753.

GUS-W-17884520.

@edmorley edmorley added the bug label Feb 21, 2025
@edmorley edmorley self-assigned this Feb 21, 2025
Heroku builds occur at a different path to which the app will be run
at run-time. As such, we have to perform path rewriting for editable
dependencies, so that they work after relocation.

The existing rewriting is performed at app boot (see code comment for
more details), and works fine with pip and Poetry.

However, I discovered that Pipenv doesn't correctly reinstall editable
VCS dependencies if they use the new PEP660 style editable interface,
which I've reported upstream here:
pypa/pipenv#6348

This issue has affected apps using editable VCS dependencies with Pipenv
for some time, but until now only at build-time for cached builds.

However, after #1753 (which thankfully isn't yet released, due to me
catching this as part of updating the tests to exercise the new PEP660
style editable interface) would otherwise affect apps at run-time too.

As a workaround, we can perform build time rewriting of paths too, but
must do so only for VCS dependencies (see code comment for why).

Lastly, the Pipenv bug also requires that we perform explicit cache
invalidation for Pipenv apps after the src dir move in #1753.

GUS-W-17884520.
@edmorley edmorley force-pushed the rewrite-editable-vcs-paths branch from ad6bc0f to f1d761f Compare February 21, 2025 21:06
@edmorley edmorley marked this pull request as ready for review February 21, 2025 21:10
@edmorley edmorley requested a review from a team as a code owner February 21, 2025 21:10
@edmorley edmorley enabled auto-merge (squash) February 21, 2025 21:10
@edmorley edmorley disabled auto-merge February 21, 2025 22:19
@edmorley edmorley merged commit b38d462 into main Feb 22, 2025
7 checks passed
@edmorley edmorley deleted the rewrite-editable-vcs-paths branch February 22, 2025 08:21
@heroku-linguist heroku-linguist bot mentioned this pull request Feb 24, 2025
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.

2 participants