Vendor third party library dep-logic
to calculate disjoint specifiers
#13076
Labels
project: vendored dependency
Related to a vendored dependency
state: needs discussion
This needs some more discussion
What's the problem this feature will solve?
Currently when pip is backtracking and displaying a
ResolutionImpossible
error to the user it uses, and shows, respectively the entire output of the resolvelib "causes".One might intuitively assume that "causes" mean that they have requirements that are disjoint from each other, but resolvelib is more generic a resolution library than that and doesn't have an understanding of disjoint or versions or specifiers (etc.) that is left to the provider.
Instead what "causes" mean, is if
A
depends onD > 1
andB
depends onD > 2
andC
depends onD < 2
thenA
,B
, andC
are all causes as requesting all of them results in the provider saying there is not a solution.Describe the solution you'd like
I plan to implement a very simple disjoint API in resolvelib (sarugaku/resolvelib#179) that will allow the provider to tell resolvelib which causes are actually disjoint and therefore the actual backtrack causes.
However, as packaging has no way to determine if two specifiers are disjoint (pypa/packaging#776) I would look to use dep-logic which does: https://github.com/pdm-project/dep-logic
The only place I would look to use this is in this new resolvelib disjoint API, and I would code it defensively so even if dep-logic is wrong and checking against it does not produce at least two disjoint causes then it would fallback to the existing behavior of returning all causes.
I am making this issue now to get any feedback or objections from pip maintainers with vendoring dep-logic.
Alternative Solutions
Do nothing.
Additional context
This can significantly speed up certain complex backtracking scenarios, as well as improving a complaint about
ResolutionImpossible
UX that you see lots of causes that aren't related to why there was aResolutionImpossible
(e.g. #11703)Code of Conduct
The text was updated successfully, but these errors were encountered: