-
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
Reduce usage of RequirementSet in commands #7704
Reduce usage of RequirementSet in commands #7704
Conversation
This was moved to RequirementCommand.populate_requirement_set, so it's no longer applicable in this context.
This makes the resolver interface simpler by returning a brand new RequirementSet vs mutating the one that was input to the function, and will let us specialize RequirementSet for the different use cases.
This reduces our dependence on the input RequirementSet.
Further simplifies the Resolver interface, and will give us the opportunity to remove any knowledge of RequirementSet from the individual commands.
Next we can hide RequirementSet from the setup phase of the individual commands.
Reduces our dependency on RequirementSet in individual commands. The default value for this is True, used everywhere except InstallCommand.
This only needed a list of requirements, so give it just that.
Concentrates use of RequirementSet in individual commands so we can eventually break it up.
0b36b7a
to
e7998a3
Compare
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.
LGTM barring one comment regarding the resolve
method.
TIL, code >> text, when communicating ideas for a refactor. :)
As a followup, with the sole exception of the Would this be worth doing? I have a half-prepared PR which I can finish if it seems worthwhile. |
It is worth doing, yea. I'm not sure what your PR looks like, but it might make sense to have separate PRs to get rid of successfully_downloaded, and then stop returning requirementset. (sorry for typos/weird capitalization, on mobile) |
See #7710 for the first step (moving the |
Previously we were using a RequirementSet to hold all of our parsed InstallRequirements, passing it to Resolver to mutate, and then reading from the updated RequirementSet to get our installed/downloaded InstallRequirements.
Now we only expose RequirementSet as the result of Resolver.resolve, and hide it as an implementation detail for holding parsed InstallRequirements. This means when implementing the new resolver we now only need to worry about translating InstallRequirements before invoking it and not both InstallRequirements and a RequirementSet.
Fixes #7571 and fixes #7638.