Repository navigation
Done
Description
Currently it is possible to add your own custom error messages. However, it can now quickly explode with the information that is displayed.
E.g with usage in RIP
× Could not solve for the requested requirements:
│ The following packages are incompatible
│ |-- opentelemetry-exporter-prometheus * cannot be installed because there are no viable options:
│ |-- opentelemetry-exporter-prometheus 1.12.0rc1 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 1.10a0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.42b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.41b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.40b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.39b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.38b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.37b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.36b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.35b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.34b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.33b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.32b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.30b1 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.30b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.29b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.17b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.16b1 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.16b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.15b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.14b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.13b0 is excluded because prereleases are not allowed
│ |-- opentelemetry-exporter-prometheus 0.12b0 is excluded because prereleases are not allowedIt would be good to create certain version ranges for instance that could collapse into a single message.
Also see this issue in rip for another example: prefix-dev/rip#26
The difficulty with this is that users can provider their own way to display errors so ideally we provide the tools to make these error messages nice. I think there are some ways to generalize this over packaging ecosystems.
Metadata
Metadata
Assignees
Labels
No labels
Activity
baszalmstra commentedon Dec 15, 2023
See also: pubgrub-rs/pubgrub#163
Or more generally the work on the simplify method in pubgrub.
[-]Make error messages a bit better[/-][+]Improve error messages[/+]aochagavia commentedon Jan 31, 2024
Note that we already implement something akin to PubGrub's error simplification algorithm, based on this blogpost.
There are still a few improvements we could make, though:
|-- requests 2.2.1 | 2.3.0 | 2.4.0 | 2.4.1 | ...).|-- requests >=2.2.1, <= 2.31.0. This is much more concise than listing ~20 different versions! The hard part is, however, that ranges are not necessarily contiguous so there might be edge cases to watch out for. I'll be thinking about it.Edit: I also see now that the simplification step doesn't seem to be implemented for Excluded stuff. That's something to fix as well (sub-edit: done in this PR).
wolfv commentedon Jan 31, 2024
I think computing ranges shouldn't be that hard, should it? We would just need to:
But maybe I am not seeing some complications.
aochagavia commentedon Jan 31, 2024
Maybe it is easy after all, I'll be prototyping :)
AntoinePrv commentedon Jan 31, 2024
Version ranges would be nice indeed. We never looked into it in Mamba because when this was done we had no
Versionimplementation (all deep inside libsolv) and were limited to treating it as strings.Two complications might be:
[min, max]might include packages that were not in the list (I don't think this happens often).pythonpython_abimess.But definitely worth a try ! Another thing I would have tried was changing the merge criteria more or less aggressively, depending on if packages have the same version major or minor etc. (this would then be controlled by verbosity).
Eh2406 commentedon Jan 31, 2024
In PubGrub-rs we had a similar issue with converting
1 | 2 | 3 | ... | n - 1 | ninto>=1 & <=n, while correctly handling important holes. The PR I cam up with is at pubgrub-rs/pubgrub#156. I think it can be used by constructing a range that is the union of singletons for all versions that have the same reason, then simplify the result.h-vetinari commentedon Dec 3, 2026
Context for the closure?
baszalmstra commentedon Dec 3, 2026
this has much improved on main