-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Description
What's the problem this feature will solve?
When a user has a complex requirements set it's possible that the backtracking can take hours / days / years to find a solution.
In a large requirements list it can be unclear why pip is backtracking as the conflict may exist many layers deep that the user does not know about.
Adding a max backtracking option attempts to solve 2 use cases:
- When a user is debugging they can set max backtracking to 0 and be able to manually inspect the failure causes and improve their requirements
- When a user is paying for CPU time, e.g. in a cloud environment, they may prefer pip to fail early in backtracking rather than run for hours. In this case they could set say a "reasonable" max backtracking such as 100 or 1000
Describe the solution you'd like
- Add a maximum backtrack count to pip CLI and pass to the Resolution object
- Add a
self._backtrack_countto Resolution object - When backtracking increment
self._backtrack_countand check if exceeds the maximum backtrack count - If it exceeds the maximum backtrack count log an error message that this happened and raise
raise ResolutionImpossible(causes)so the user can inspect the current error was causing the backtracking
Additional context
This requires adding to the pip CLI, updating resolvelib, adding many test cases, and updating the documentation. I currently don't have a strong enough understanding of pip's code base to implement all of this. But if no one else works on this I will try and eventually submit the relevant PRs.
Metadata
Metadata
Assignees
Labels
No labels