-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add hint when resolution impossible causes have no versions available #13588
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
base: main
Are you sure you want to change the base?
Add hint when resolution impossible causes have no versions available #13588
Conversation
20d0197
to
1a2599c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test for this behaviour?
Added a test. Also, I got rid of filtering yanked packages (as the requirement could be
Separately, I think I've come up with a good idea for showing individual requirements have no versions available, but the logic will be a bit more complicated, and I don't think it will negate this being a helpful hint to users, so I follow up with another PR when I have time. |
I reworded the hint again (writing is hard), to try and make clear it's the project as whole that has no matching distributions, not just the specific requirements listed above:
I will stop updating now, unless someone reviews and provides a better suggestion. Otherwise I think this is ready. |
At some point, I would like to improve the no distributions found error to give hints at WHY no distributions were found. This is linked in with my (stalled) effort to improve "this wheel is not compatible on this platform" errors. This is a good improvement on its own, but if pip ever gains a better "no distributions were found" error, it'd be good to use the same error reporting machinery. |
@ichard26 I 100% agree, WHY should be the ultimate goal of resolution impossible errors. This is an improvement on the WHAT, broadening the number of cases where users can have enough information to try and manually figure out the WHY themselves. I think this WHAT and WHY is a good way of framing these errors, and I have a future improvement in mind now to the WHAT some time after this lands. |
I have seen this as a common cause for confusion when hitting
ResolutionImpossible
errors, the are no packages available for a particular dependency or transitive dependency on a user's platform, but the resolution impossible message does not make that clear.Here is an older example, nuclia/nucliadb#977, running a similar command:
Produces a very long error message with a lot of:
This PR adds a strong hint to the user the issue is that given their platform there aren't any packages to select:
An alternative solution would be evaluate how many candidates are available for each cause and add a note into the conflict is caused by message, e.g.
This could be more informative in some situations, but I don't think the messaging is as clear or obvious.