Skip to content

Commit

Permalink
Merge pull request #9100 from uranusjr/new-resolver-deterministic-ord…
Browse files Browse the repository at this point in the history
…ering

Tie-break requirements with package name
  • Loading branch information
pradyunsg authored Nov 8, 2020
2 parents 0512785 + 69a95cf commit ee7c56e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/9100.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The new resolver now resolves packages in a deterministic order.
3 changes: 2 additions & 1 deletion src/pip/_internal/resolution/resolvelib/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def get_preference(
):
# type: (...) -> Any
transitive = all(parent is not None for _, parent in information)
return (transitive, bool(candidates))
key = next(iter(candidates)).name if candidates else ""
return (transitive, key)

def find_matches(self, requirements):
# type: (Sequence[Requirement]) -> Iterable[Candidate]
Expand Down

0 comments on commit ee7c56e

Please sign in to comment.