Skip to content

Confusing error message when specifying two contradictory specs #26

Open

Description

@notatallshaw

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?

Activity

  1. baszalmstra commented on Sep 28, 2023

    @baszalmstra
    Contributor

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

  2. tdejager commented on Sep 29, 2023

    @tdejager
    Contributor

    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?

  3. notatallshaw commented on Sep 29, 2023

    @notatallshaw
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions