mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-19 11:35:36 +00:00
Avoid showing negations of ranges in error messages (#981)
Closes https://github.com/astral-sh/puffin/issues/980
This commit is contained in:
parent
02ed195982
commit
ae7a2cddc2
2 changed files with 7 additions and 3 deletions
|
|
@ -433,7 +433,11 @@ impl std::fmt::Display for PackageTerm<'_> {
|
||||||
let package = self.package;
|
let package = self.package;
|
||||||
write!(f, "{package}!={version}")
|
write!(f, "{package}!={version}")
|
||||||
} else {
|
} else {
|
||||||
write!(f, "!( {} )", PackageRange::compatibility(self.package, set))
|
write!(
|
||||||
|
f,
|
||||||
|
"{}",
|
||||||
|
PackageRange::compatibility(self.package, &set.complement())
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -695,10 +695,10 @@ fn dependency_excludes_non_contiguous_range_of_compatible_versions() -> Result<(
|
||||||
albatross>1.0.0,<2.0.0
|
albatross>1.0.0,<2.0.0
|
||||||
we can conclude that albatross<2.0.0 depends on bluebird==1.0.0.
|
we can conclude that albatross<2.0.0 depends on bluebird==1.0.0.
|
||||||
And because we know from (1) that crow<2.0.0 depends on albatross<2.0.0, we can conclude that crow<2.0.0 depends on bluebird==1.0.0.
|
And because we know from (1) that crow<2.0.0 depends on albatross<2.0.0, we can conclude that crow<2.0.0 depends on bluebird==1.0.0.
|
||||||
And because crow==2.0.0 depends on albatross>=3.0.0 we can conclude that all versions of crow, bluebird!=1.0.0, !( albatross>=3.0.0 ) are incompatible. (2)
|
And because crow==2.0.0 depends on albatross>=3.0.0 we can conclude that all versions of crow, bluebird!=1.0.0, albatross<3.0.0 are incompatible. (2)
|
||||||
|
|
||||||
Because albatross==3.0.0 depends on bluebird==3.0.0 and only albatross<=3.0.0 is available, we can conclude that albatross>=3.0.0 depends on bluebird==3.0.0.
|
Because albatross==3.0.0 depends on bluebird==3.0.0 and only albatross<=3.0.0 is available, we can conclude that albatross>=3.0.0 depends on bluebird==3.0.0.
|
||||||
And because we know from (2) that all versions of crow, bluebird!=1.0.0, !( albatross>=3.0.0 ) are incompatible, we can conclude that all versions of crow depend on one of:
|
And because we know from (2) that all versions of crow, bluebird!=1.0.0, albatross<3.0.0 are incompatible, we can conclude that all versions of crow depend on one of:
|
||||||
bluebird<=1.0.0
|
bluebird<=1.0.0
|
||||||
bluebird>=3.0.0
|
bluebird>=3.0.0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue