diff --git a/news/9100.feature.rst b/news/9100.feature.rst new file mode 100644 index 00000000000..eb6c7283948 --- /dev/null +++ b/news/9100.feature.rst @@ -0,0 +1 @@ +The new resolver now resolves packages in a deterministic order. diff --git a/src/pip/_internal/resolution/resolvelib/provider.py b/src/pip/_internal/resolution/resolvelib/provider.py index 7f7d0e1540b..c0e6b60d90a 100644 --- a/src/pip/_internal/resolution/resolvelib/provider.py +++ b/src/pip/_internal/resolution/resolvelib/provider.py @@ -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]