-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[fast-deps] Caching during dependency resolution #8720
Comments
The first thing I'll try to do is to avoid the lazy wheel from being used if the distribution is available in the wheel cache, and probably the download directory since the two are handled pretty closely in the execution path. pip's current implementation of HTTP cache doesn't work out of the box for range requests (GH-8701) but it might be possible. |
If the distribution is in the cache, I think we can skip the fast-deps logic for it. There's no point doing a "partial" download, for something that's available in a local cache. |
A few possible approaches for handling the HTTP cache:
The last two assume we make cachecontrol Range-request aware, and I'm not sure what the effort for that would be. I would guess not much if there's agreement on how it should behave. If we go that way then it'd be good to compare what we can do internally vs changes that'd be best made upstream in cachecontrol itself. |
I just found out that wheel cache is handled by the resolver: pip/src/pip/_internal/resolution/resolvelib/candidates.py Lines 265 to 281 in c50307e
Download folders will be checked with GH-8804 merged. I will try to see what are the possibilities with HTTP cache. |
Depending on the command, the file may already exist:
pip install
- wheel cache or HTTP cachepip wheel
- wheel download folder, wheel cache, or HTTP cachepip download
- download folder, wheel cache, or HTTP cacheIn all three cases, I think the wheel cache piece may be handled earlier during resolving, so we wouldn't inadvertently use a lazy wheel for it.
In all three cases, it may be the case that the file we want is already in the HTTP cache. I don't know if range requests bypass the HTTP cache or it does what we want (which would be to return the requested bytes from the file on disk). Maybe it is worth it to see if the request is cached first, and just skip the lazy wheel?
In
pip wheel
andpip download
, the user may have already downloaded some of the files, and we would want to be able to use those rather than lazily downloading the metadata. Note that the logic refactored in #8685 does not account for this.Originally posted by @chrahunt in #8697 (comment)
The text was updated successfully, but these errors were encountered: