Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor third party library dep-logic to calculate disjoint specifiers #13076

Open
1 task done
notatallshaw opened this issue Nov 11, 2024 · 0 comments
Open
1 task done
Labels
project: vendored dependency Related to a vendored dependency state: needs discussion This needs some more discussion

Comments

@notatallshaw
Copy link
Member

notatallshaw commented Nov 11, 2024

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 on D > 1 and B depends on D > 2 and C depends on D < 2 then A, B, and C 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 a ResolutionImpossible (e.g. #11703)

Code of Conduct

@notatallshaw notatallshaw added type: feature request Request for a new feature S: needs triage Issues/PRs that need to be triaged project: vendored dependency Related to a vendored dependency state: needs discussion This needs some more discussion and removed type: feature request Request for a new feature S: needs triage Issues/PRs that need to be triaged labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: vendored dependency Related to a vendored dependency state: needs discussion This needs some more discussion
Projects
None yet
Development

No branches or pull requests

1 participant