mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-21 07:42:05 +00:00
Use dense formatting for requirement version specifiers in diagnostics (#2601)
For consistency with the output in "no solution" errors
This commit is contained in:
parent
90a1f89ac4
commit
d0cb301d59
5 changed files with 26 additions and 26 deletions
|
@ -243,7 +243,7 @@ impl Display for Requirement {
|
|||
VersionOrUrl::VersionSpecifier(version_specifier) => {
|
||||
let version_specifier: Vec<String> =
|
||||
version_specifier.iter().map(ToString::to_string).collect();
|
||||
write!(f, " {}", version_specifier.join(", "))?;
|
||||
write!(f, "{}", version_specifier.join(","))?;
|
||||
}
|
||||
VersionOrUrl::Url(url) => {
|
||||
// We add the space for markers later if necessary
|
||||
|
@ -1627,7 +1627,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn basic_examples() {
|
||||
let input = r"requests[security,tests] >=2.8.1, ==2.8.* ; python_version < '2.7'";
|
||||
let input = r"requests[security,tests]>=2.8.1,==2.8.* ; python_version < '2.7'";
|
||||
let requests = Requirement::from_str(input).unwrap();
|
||||
assert_eq!(input, requests.to_string());
|
||||
let expected = Requirement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue