mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Improve root message when version solving fails (#344)
Matching description at https://github.com/dart-lang/pub/blob/master/doc/solver.md#linear-error-reporting
This commit is contained in:
parent
b0720ea5b2
commit
e952557bf1
4 changed files with 13 additions and 16 deletions
|
@ -6,9 +6,9 @@ info:
|
|||
- pip-compile
|
||||
- pyproject.toml
|
||||
- "--cache-dir"
|
||||
- /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmp2JLrkd
|
||||
- /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpCU1Ejn
|
||||
env:
|
||||
VIRTUAL_ENV: /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmp0ZV4ob/.venv
|
||||
VIRTUAL_ENV: /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpnY10Er/.venv
|
||||
---
|
||||
success: false
|
||||
exit_code: 1
|
||||
|
@ -17,5 +17,5 @@ exit_code: 1
|
|||
----- stderr -----
|
||||
× No solution found when resolving dependencies:
|
||||
╰─▶ Because there is no version of django available matching ==300.1.4 and
|
||||
my-project depends on django==300.1.4, my-project cannot be satisfied.
|
||||
my-project depends on django==300.1.4, version solving failed.
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ info:
|
|||
- pip-compile
|
||||
- requirements.in
|
||||
- "--cache-dir"
|
||||
- /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpYAeXfn
|
||||
- /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpZftc6D
|
||||
env:
|
||||
VIRTUAL_ENV: /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpf7hodD/.venv
|
||||
VIRTUAL_ENV: /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpuYGAMB/.venv
|
||||
---
|
||||
success: false
|
||||
exit_code: 1
|
||||
|
@ -17,5 +17,5 @@ exit_code: 1
|
|||
----- stderr -----
|
||||
× No solution found when resolving dependencies:
|
||||
╰─▶ Because there is no version of werkzeug available matching ==3.0.0 and
|
||||
root depends on werkzeug==3.0.0, root cannot be satisfied.
|
||||
root depends on werkzeug==3.0.0, version solving failed.
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ info:
|
|||
- pip-compile
|
||||
- requirements.in
|
||||
- "--cache-dir"
|
||||
- /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpiccUSp
|
||||
- /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpMkgmyj
|
||||
env:
|
||||
VIRTUAL_ENV: /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpCLX1o7/.venv
|
||||
VIRTUAL_ENV: /var/folders/bc/qlsk3t6x7c9fhhbvvcg68k9c0000gp/T/.tmpGndWSU/.venv
|
||||
---
|
||||
success: false
|
||||
exit_code: 1
|
||||
|
@ -17,6 +17,6 @@ exit_code: 1
|
|||
----- stderr -----
|
||||
× No solution found when resolving dependencies:
|
||||
╰─▶ Because there is no version of werkzeug available matching >=3.0.0 and
|
||||
flask==3.0.0 depends on werkzeug>=3.0.0, flask ==3.0.0 is forbidden.
|
||||
And because root depends on flask==3.0.0, root cannot be satisfied.
|
||||
flask==3.0.0 depends on werkzeug>=3.0.0, flask==3.0.0 is forbidden.
|
||||
And because root depends on flask==3.0.0, version solving failed.
|
||||
|
||||
|
|
|
@ -268,15 +268,12 @@ impl ResolutionFailureReporter {
|
|||
pub fn string_terms(terms: &Map<PubGrubPackage, Term<Range<PubGrubVersion>>>) -> String {
|
||||
let terms_vec: Vec<_> = terms.iter().collect();
|
||||
match terms_vec.as_slice() {
|
||||
[] => "version solving failed".into(),
|
||||
[(package @ PubGrubPackage::Root(_), _)] => {
|
||||
format!("{package} cannot be satisfied")
|
||||
}
|
||||
[] | [(PubGrubPackage::Root(_), _)] => "version solving failed".into(),
|
||||
[(package @ PubGrubPackage::Package(..), Term::Positive(range))] => {
|
||||
format!("{package} {range} is forbidden")
|
||||
format!("{package}{range} is forbidden")
|
||||
}
|
||||
[(package @ PubGrubPackage::Package(..), Term::Negative(range))] => {
|
||||
format!("{package} {range} is mandatory")
|
||||
format!("{package}{range} is mandatory")
|
||||
}
|
||||
[(p1, Term::Positive(r1)), (p2, Term::Negative(r2))] => {
|
||||
PuffinExternal::FromDependencyOf(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue