Skip to content

Commit

Permalink
Tie-break requirements with package name
Browse files Browse the repository at this point in the history
This makes the ordering deterministic to improve debugging and user
experience.
  • Loading branch information
uranusjr committed Nov 4, 2020
1 parent 0512785 commit cf2b121
Showing 1 changed file with 2 additions and 1 deletion.
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 cf2b121

Please sign in to comment.