-
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
Avoid preparing metadata when pip download
with --ignore-requires-python --no-deps
#9311
Conversation
pip download
with --ignore-requires-python --no-deps
This is the second time I'm seeing this failure happen on MacOS / Python 3.8 CI -- unrelated to this change.
|
Yea, that's a pytest-xdist bug. :( |
The main issue I have with the current approach is that the call path of In particular, #9289 moves the preparation into So I think the best approach here instead is to analyse why |
@@ -143,8 +143,8 @@ def source_link(self): | |||
# type: () -> Optional[Link] | |||
raise NotImplementedError("Override in subclass") | |||
|
|||
def iter_dependencies(self, with_requires): | |||
# type: (bool) -> Iterable[Optional[Requirement]] | |||
def iter_dependencies(self, with_requires, ignore_requires_python): |
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.
def iter_dependencies(self, with_requires, ignore_requires_python): | |
def iter_dependencies(self, with_requires, with_requires_python): |
For consistency internally in the pip._internal.resolution.resolvelib
package?
I'd like to suggest that this PR is still relevant by itself, because it decouples making a The patch moves the logic to where it belongs along with
I agree, in fact #1884 (comment) and this "work in progress" commit https://github.com/nikitos3000/pip/commit/391467d6be2363b651dba6f8fc2f94088f8e2937 are part of my attempt to decouple the download process from preparing metadata. What do you think about this approach? If |
I don’t think it’s a good idea to merge this without the benefit of skipping metadata preparation, since this PR would only move some arguments without changing anything. You may think it is better to have |
agree, closing for now |
Now that #9289 is merged, I should put this back to my backlog and investigate what needs to change to make it happen. |
Depends on: #9305
Originated in: #1884
The goal of this PR is to avoid calling
Candidate._prepare()
when it's not necessary.Without this change, the following call chain happens:
In other words, if this check was done earlier - we can avoid running candidate
setup.py
when--ignore-requires-python
is given.Another argument might be that this check doesn't belong to the
Factory
, and similar toiter_dependencies(with_requires)
should be passed down toCandidate
fromProvider.get_dependencies()
.