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

Confusing error message when specifying two contradictory specs #26

Open
notatallshaw opened this issue Sep 28, 2023 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@notatallshaw
Copy link

This example is obvious but it can get more complicated quickly:

$ cargo r -- "requests>2.2" "requests<2.1"
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/rip 'requests>2.2' 'requests<2.1'`
  × Could not solve for the requested requirements:
  │ The following packages are incompatible
  │ |-- requests < 2.1 can be installed with any of the following options:
  │     |-- requests 2.0.1
  │     |-- requests 2.0.0
  │ |-- requests > 2.2 cannot be installed because there are no viable options:
  │     |-- requests 2.2.1 | 2.3.0 | 2.4.0 | 2.4.1 | 2.4.2 | 2.4.3 | 2.5.0 | 2.5.1 | 2.5.2 | 2.5.3 | 2.6.0 | 2.6.1 | 2.6.2 | 2.7.0 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.9.2 | 2.10.0 | 2.11.0 | 2.11.1 | 2.12.0 | 2.12.1 | 2.12.2 | 2.12.3 | 2.12.4 | 2.12.5 | 2.13.0 | 2.14.0 | 2.14.1 | 2.14.2 | 2.15.1 | 2.16.0 | 2.16.1
  │ | 2.16.2 | 2.16.3 | 2.16.4 | 2.16.5 | 2.17.0 | 2.17.1 | 2.17.2 | 2.17.3 | 2.18.0 | 2.18.1 | 2.18.2 | 2.18.3 | 2.18.4 | 2.19.0 | 2.19.1 | 2.20.0 | 2.20.1 | 2.21.0 | 2.22.0 | 2.23.0 | 2.24.0 | 2.25.0 | 2.25.1 | 2.26.0 | 2.27.0 | 2.27.1 | 2.28.0 | 2.28.1 | 2.28.2 | 2.29.0 | 2.30.0 | 2.31.0, which conflicts with
  │ the versions reported above.
  │

It appears to be saying that "2.3.0" is not compatible with the spec "requests > 2.2". Which is ofcourse incorrect.

Also would it be possible to put a check in before going out to the index to see if two top level requirements are mutually incompatible?

@baszalmstra
Copy link
Contributor

Thanks for testing! I appreciate it! We'll take a look!

@tdejager
Copy link
Contributor

tdejager commented Sep 29, 2023

So actually the error message is correct, but it is a bit hard to wrap your head around, I agree :)

So it's saying basically:

requests < 2.1 can be installed with: 2.0.1, 2.0.0
requests > 2.2 can be installed with: 2.2.1 up to 2.31.0, but these conflict with the versions reported in the previous VersionSet

We could have a look at making this clearer, I suppose collapsing the versions in a range would help. @notatallshaw any other ideas?

@notatallshaw
Copy link
Author

Ah, I think what's confusing for me is the wording "versions reported above" which on my screen looks like the revisions reported for requests > 2.2

Maybe "previously reported versions" would be more clear?

I'm not that strongly opinionated on a solution, more just wanted to report it was confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants