Description
Description
Offline installations of a package with a VCS URL dependency fails even if the dependency is already installed. This happens because pip tries to pull the VCS URL, and when it can't it fails.
Recently (not sure when, possibly when the new resolver rolled out), I believe VCS-specified dependencies became "eager by default" in pip
, so that they are downloaded even when already installed (to install and check version metadata, etc). This means that invoking pip install
with VCS URL dependencies fails offline. To counteract this, we can use --no-deps
to not install the dependencies, but then you must forego the version checking that pip
does on all the other packages which are currently installed. Alternatively, I get around both problems using --use-deprecated legacy-resolver
.
I marked this as a "bug" rather than a "feature request" as the old resolver worked here, but the new resolver does not.
I see at least two workable solutions for this problem, maybe there are other ideas:
- add a flag to not eagerly install vcs-specified dependencies if they're already installed
- add a command to explicitly check against version requirements (e.g. check your environment meets the current packages) (potentially similar to a
pip resolve
Apip resolve
command to convert to transitive == requirements very fast by scanning wheels for static dependency info (WORKING PROTOTYPE!) #7819)
Expected behavior
There should be a way to install a package with VCS dependencies offline while version checking the other requirements.
pip version
21.3
How to Reproduce
I've uploaded a very basic example with a descriptive README here: https://github.com/alkasm/test-vcs-offline
Code of Conduct
- I agree to follow the PSF Code of Conduct.