Skip to content

Commit e1a8beb

Browse files
authored
Simplify version ranges reported for unavailable packages (#6155)
Now that these incompatibilities are collected into a single range (#6154), we can simplify the range using the known available versions to reduce verbosity.
1 parent 3a46e48 commit e1a8beb

File tree

3 files changed

+9
-43
lines changed

3 files changed

+9
-43
lines changed

crates/uv-resolver/src/pubgrub/report.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ impl ReportFormatter<PubGrubPackage, Range<Version>, UnavailableReason>
120120
format!("{}{reason}", Padded::new("", &package, " "))
121121
}
122122
UnavailableReason::Version(reason) => {
123+
let set = self.simplify_set(set, package);
123124
format!(
124125
"{}{reason}",
125-
Padded::new("", &self.compatible_range(package, set), " ")
126+
Padded::new("", &self.compatible_range(package, &set), " ")
126127
)
127128
}
128129
}

crates/uv/tests/cache_prune.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,8 @@ fn prune_unzipped() -> Result<()> {
242242
iniconfig<=0.1
243243
iniconfig>=1.0.0
244244
and any of:
245-
iniconfig==0.1
246-
iniconfig==1.0.0
247-
iniconfig==1.0.1
248-
iniconfig==1.1.0
249-
iniconfig==1.1.1
250-
iniconfig==2.0.0
245+
iniconfig<=0.1
246+
iniconfig>=1.0.0
251247
needs to be downloaded from a registry, we can conclude that iniconfig<1.0.0 cannot be used.
252248
And because you require iniconfig, we can conclude that your requirements are unsatisfiable.
253249

crates/uv/tests/pip_install.rs

+5-36
Original file line numberDiff line numberDiff line change
@@ -1926,42 +1926,11 @@ fn install_only_binary_all_and_no_binary_all() {
19261926
anyio>=3.7.0,<=3.7.1
19271927
anyio>=4.0.0
19281928
and any of:
1929-
anyio==1.0.0
1930-
anyio==1.1.0
1931-
anyio==1.2.0
1932-
anyio==1.2.1
1933-
anyio==1.2.2
1934-
anyio==1.2.3
1935-
anyio==1.3.0
1936-
anyio==1.3.1
1937-
anyio==1.4.0
1938-
anyio==2.0.0
1939-
anyio==2.0.1
1940-
anyio==2.0.2
1941-
anyio==2.1.0
1942-
anyio==2.2.0
1943-
anyio==3.0.0
1944-
anyio==3.0.1
1945-
anyio==3.1.0
1946-
anyio==3.2.0
1947-
anyio==3.2.1
1948-
anyio==3.3.0
1949-
anyio==3.3.1
1950-
anyio==3.3.2
1951-
anyio==3.3.3
1952-
anyio==3.3.4
1953-
anyio==3.4.0
1954-
anyio==3.5.0
1955-
anyio==3.6.0
1956-
anyio==3.6.1
1957-
anyio==3.6.2
1958-
anyio==3.7.0
1959-
anyio==3.7.1
1960-
anyio==4.0.0
1961-
anyio==4.1.0
1962-
anyio==4.2.0
1963-
anyio==4.3.0
1964-
anyio==4.4.0
1929+
anyio>=1.0.0,<=1.4.0
1930+
anyio>=2.0.0,<=2.2.0
1931+
anyio>=3.0.0,<=3.6.2
1932+
anyio>=3.7.0,<=3.7.1
1933+
anyio>=4.0.0
19651934
has no usable wheels and building from source is disabled, we can conclude that any of:
19661935
anyio<1.1.0
19671936
anyio>1.4.0,<2.0.0

0 commit comments

Comments
 (0)