mamba-org / rattler

Rust crates to work with the Conda ecosystem.
BSD 3-Clause "New" or "Revised" License
226 stars 42 forks source link

fix: issue 717 #732

Closed baszalmstra closed 1 month ago

baszalmstra commented 1 month ago

Fixes #717 Fixes https://github.com/prefix-dev/pixi/issues/1469

This fixes parsing of ray[default,data] >=2.9.0,<3.0.0 to fail with InvalidPackageName instead of InvalidBracket.

baszalmstra commented 1 month ago

I also modified the solver to return that the dependencies are unavailable if it contains invalid matchspecs. If no other solution is found this will result in an error like:

Cannot solve the request because of: The following packages are incompatible
└─ issue_717 * cannot be installed because there are no viable options:
   └─ issue_717 2.1 is excluded because the constrains 'ray[default,data] >=2.9.0,<3.0.0' failed to parse: 'ray[default,data]' is not a valid package name. Package names can only contain 0-9, a-z, A-Z, -, _, or .
wolfv commented 1 month ago

the error message is beautiful, for sure, but I am wondering if we shouldn't just ignore that particular constraint?

baszalmstra commented 1 month ago

For constraints it doesnt really matter. Conda simply swallows this matchspec and then constrains any package called "ray[default,data]" which will never exist so it will not constrain anything. In that case I would be fine to just ignore it. However for requirements I think we should keep this way because most likely the spec is there for a reason.

But in either way I prefer to be explicit.