Skip to content
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

Remove RequirementSet.require_hashes #7068

Merged
merged 3 commits into from
Oct 20, 2019

Conversation

chrahunt
Copy link
Member

@chrahunt chrahunt commented Sep 22, 2019

The purpose of this change is two-fold:

  1. Reduce coupling between Resolver and RequirementSet, towards the goal of having Resolver.resolve() accept a plain Iterable[InstallRequirement]
  2. Simplify RequirementSet itself, since after build refactoring it should not need to exist

This does add one parameter to Resolver, however in later refactoring we should be able to encapsulate all of the hash-related logic in an object that Resolver would use to query for and prepare requirements.

@chrahunt chrahunt added type: refactor Refactoring code skip news Does not need a NEWS file entry (eg: trivial changes) labels Sep 22, 2019
@chrahunt chrahunt marked this pull request as ready for review September 22, 2019 23:42
Copy link
Member

@cjerdonek cjerdonek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments. Also, a question: do we know that resolve() is only called once?

src/pip/_internal/legacy_resolve.py Outdated Show resolved Hide resolved
src/pip/_internal/legacy_resolve.py Outdated Show resolved Hide resolved
@pradyunsg
Copy link
Member

do we know that resolve() is only called once?

Right now, yes. I think it's reasonable to expect that to stay true going forward but I do prefer if we defer making that choice until we see that as being something that causes functional issues.

@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will be eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Oct 8, 2019
Removes the only dynamic state from Resolver, at the cost of passing
an extra variable to 2 methods.
This removes some of the dependence of the Resolver on our specific
RequirementSet implementation.
@chrahunt chrahunt force-pushed the refactor/decouple-req-set-resolver branch from a47803f to b8fb97a Compare October 13, 2019 17:21
@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Oct 13, 2019
@chrahunt
Copy link
Member Author

Updated and ready for review. Since there is now no state being changed within Resolver, we do not require that resolve() is only called once (since we want to avoid imposing that restriction right now).

@pradyunsg pradyunsg merged commit 9ab9040 into pypa:master Oct 20, 2019
@chrahunt chrahunt deleted the refactor/decouple-req-set-resolver branch October 20, 2019 11:44
atugushev added a commit to atugushev/pip-tools that referenced this pull request Oct 20, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Nov 19, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation skip news Does not need a NEWS file entry (eg: trivial changes) type: refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants