-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
PEP660 editable VCS dependencies not reinstalled correctly #6348
Comments
edmorley
added a commit
to heroku/heroku-buildpack-python
that referenced
this issue
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.
edmorley
added a commit
to heroku/heroku-buildpack-python
that referenced
this issue
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.
edmorley
added a commit
to heroku/heroku-buildpack-python
that referenced
this issue
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
added a commit
to heroku/heroku-buildpack-python
that referenced
this issue
Feb 22, 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description
For editable VCS (eg Git) dependencies, re-running
pipenv install
does not reinstall the dependency if the linked source repository checkout is missing (eg if it has been moved to a different path, or otherwise removed).This appears to only affect PEP 660 style editable installs.
Expected result
For
pipenv install
to reinstall an editable VCS dependency, if thesrc/
directory containing the repository checkout has been removed since the last timepipenv install
was run.For example, this works with pip:
Actual result
Pipenv doesn't reinstall the editable VCS dependency - the
pipenv install
is a no-op:Which then results in a
ModuleNotFoundError
:Steps to replicate
Create a
Dockerfile
, with contents:Then run it with:
docker build . --progress plain --no-cache
Additional findings
If I downgrade the gunicorn version, to one that uses
setup.py
instead ofpyproject.toml
(by changingref = "23.0.0"
toref = "21.2.0"
) and setENV PIP_USE_PEP517=0
to force a legacysetup.py develop
editable install then this issue no longer reproduces.With the legacy editable install,
site-packages
contains:Whereas when using the PEP517 / PEP660 install (as per the
Dockerfile
above),site-packages
instead contains:As such, I've presuming this might be an issue with how Pipenv handles editable VCS dependencies specifically when they use the new PEP660 editable interface?
Is the issue somewhere here?
pipenv/pipenv/environment.py
Lines 730 to 761 in 46bc4ef
The text was updated successfully, but these errors were encountered: