diff --git a/news/10479.feature.rst b/news/10479.feature.rst index e070c0e163a..23eaa6c8faa 100644 --- a/news/10479.feature.rst +++ b/news/10479.feature.rst @@ -1 +1 @@ -New resolver: When backtracking prefer the dependencies which caused the most recent backtracking. In some cases this will significantly reduce the amount of backtracking required. +When backtracking during dependency resolution, prefer the dependencies which are involved in the most recent conflict. This can significantly reduce the amount of backtracking required. diff --git a/src/pip/_internal/resolution/resolvelib/provider.py b/src/pip/_internal/resolution/resolvelib/provider.py index 703511f3f61..f1d295aeb6a 100644 --- a/src/pip/_internal/resolution/resolvelib/provider.py +++ b/src/pip/_internal/resolution/resolvelib/provider.py @@ -205,8 +205,7 @@ def get_dependencies(self, candidate: Candidate) -> Sequence[Requirement]: @staticmethod def is_backtrack_cause( - identifier: str, - backtrack_causes: Sequence["RequirementInformation"] + identifier: str, backtrack_causes: Sequence["RequirementInformation"] ) -> bool: for backtrack_cause in backtrack_causes: if identifier == backtrack_cause.requirement.name: