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

New Resolver: Refactor iter_found_candidates #8205

Closed
pfmoore opened this issue May 7, 2020 · 1 comment
Closed

New Resolver: Refactor iter_found_candidates #8205

pfmoore opened this issue May 7, 2020 · 1 comment
Assignees

Comments

@pfmoore
Copy link
Member

pfmoore commented May 7, 2020

Writing this as a note for myself, and looking for comments on the idea.

At the moment, iter_found_candidates both gets the candidates for a given requirement, and sorts them into preference order. This means that the factory needs to know all about force_reinstall and upgrade_strategy, and the method is quite messy.

I'm thinking that it would be better to make this method just return the candidates, and defer sorting them into the correct order to a new method sort_found_candidates on the provider, which does the ordering. This allows us to put all of the data that defines the preference order (upgrade strategy, list of user requested projects, etc) onto the provider and leaves the factory state much cleaner.

There will be details I need to thrash out (notably where to build the installed distributions list and how to process it) but I think the result will be an improvement (and it'll address the "get the root requirements out of the factory" issue at the same time).

I plan on working on this over the next few days, but I'd appreciate any thoughts on whether this is a good approach. @pradyunsg @uranusjr

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label May 7, 2020
@pfmoore pfmoore self-assigned this May 7, 2020
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label May 7, 2020
@pfmoore
Copy link
Member Author

pfmoore commented Jun 4, 2020

Fixed by #8234

@pfmoore pfmoore closed this as completed Jun 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant