-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Avoid pip install --dry-run
downloading full wheels
#13482
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
196f992
a844f3b
fc2eb8d
11d2a6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
When PEP-658 metadata is available, full distribution download no longer occurs when using dry-run mode on install. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,11 +180,6 @@ def resolve( | |
|
||
req_set.add_named_requirement(ireq) | ||
|
||
reqs = req_set.all_requirements | ||
self.factory.preparer.prepare_linked_requirements_more(reqs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the key change - the resolver no longer triggers additional preparation. Instead, we move this responsibility to consumers of the resolve result. Technically, I could have made the |
||
for req in reqs: | ||
req.prepared = True | ||
req.needs_more_preparation = False | ||
return req_set | ||
|
||
def get_installation_order( | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated slightly, in-particular all sdists are still downloaded (at least for now), either specifically call out wheels or change to something like:
Or
Further, also add that
pip lock
no longer downloads distributions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's no update and no objections in the next few days I will update this news items myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically
pip
has no problem fetching metadata for sdists already 😉. So this PR does make--dry-run
avoid an sdist download/build 🎉 (this is a pretty substantial benefit as it means you don't need to build the sdist to figure out the dependencies... if only we had any repositories with sdist metadata served ala 658).To prove this, I did the following:
On the pip side, I ran:
With only the following
http.server
output:(i.e. the sdist is never downloaded)
Whereas on master (f2b9231):
With the http log:
I proceeded to try
pip lock
out on the above setup, but got a failure:I think that is because my package repository didn't include hashes...
This was the changed line in question:
When I added them it correctly generated the lock file without downloading:
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to mention anything about performance in the what's new? Whilst
pip
doesn't quite reachuv
performance, it is still very reasonable when the cache is cold! The narrative thatpip
is much slower might be nice to counter here 😉There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting about the sdists, I wasn't aware of that impact, I'll try and review later this week.
The Windows test failure looks unrelated. I'll try and make, or review, a PR to fix as soon as I can.