Skip to content

Commit

Permalink
Avoid showing negations of ranges in error messages (#981)
Browse files Browse the repository at this point in the history
Closes #980
  • Loading branch information
zanieb authored Jan 19, 2024
1 parent 02ed195 commit ae7a2cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion crates/puffin-resolver/src/pubgrub/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,11 @@ impl std::fmt::Display for PackageTerm<'_> {
let package = self.package;
write!(f, "{package}!={version}")
} else {
write!(f, "!( {} )", PackageRange::compatibility(self.package, set))
write!(
f,
"{}",
PackageRange::compatibility(self.package, &set.complement())
)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/puffin/tests/pip_install_scenarios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,10 @@ fn dependency_excludes_non_contiguous_range_of_compatible_versions() -> Result<(
albatross>1.0.0,<2.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 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.
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>=3.0.0
Expand Down

0 comments on commit ae7a2cd

Please sign in to comment.