You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 aboutforce_reinstall
andupgrade_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
The text was updated successfully, but these errors were encountered: