mirror of https://github.com/astral-sh/uv
Add handling for formatting `UnusableVersions` incompatibility
This commit is contained in:
parent
4fb2e0955e
commit
844dd0a14e
|
|
@ -2229,7 +2229,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pubgrub"
|
name = "pubgrub"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
source = "git+https://github.com/zanieb/pubgrub?rev=a1d584a5e506b8f0a600269373190c4a35b298d5#a1d584a5e506b8f0a600269373190c4a35b298d5"
|
source = "git+https://github.com/zanieb/pubgrub?rev=92a14f37192aa5cc5d48efe901546c7f7b4810b7#92a14f37192aa5cc5d48efe901546c7f7b4810b7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 2.1.0",
|
"indexmap 2.1.0",
|
||||||
"log",
|
"log",
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ once_cell = { version = "1.18.0" }
|
||||||
petgraph = { version = "0.6.4" }
|
petgraph = { version = "0.6.4" }
|
||||||
platform-info = { version = "2.0.2" }
|
platform-info = { version = "2.0.2" }
|
||||||
plist = { version = "1.6.0" }
|
plist = { version = "1.6.0" }
|
||||||
pubgrub = { git = "https://github.com/zanieb/pubgrub", rev = "a1d584a5e506b8f0a600269373190c4a35b298d5" }
|
pubgrub = { git = "https://github.com/zanieb/pubgrub", rev = "92a14f37192aa5cc5d48efe901546c7f7b4810b7" }
|
||||||
pyo3 = { version = "0.20.0" }
|
pyo3 = { version = "0.20.0" }
|
||||||
pyo3-log = { version = "0.9.0"}
|
pyo3-log = { version = "0.9.0"}
|
||||||
pyproject-toml = { version = "0.8.0" }
|
pyproject-toml = { version = "0.8.0" }
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,25 @@ impl ReportFormatter<PubGrubPackage, Range<PubGrubVersion>> for PubGrubReportFor
|
||||||
format!("dependencies of {package} at version {set} are unavailable")
|
format!("dependencies of {package} at version {set} are unavailable")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
External::UnusableVersions(package, set, reason) => {
|
||||||
|
if let Some(reason) = reason {
|
||||||
|
if matches!(package, PubGrubPackage::Root(_)) {
|
||||||
|
format!("{package} is unusable: {reason}")
|
||||||
|
} else {
|
||||||
|
if set == &Range::full() {
|
||||||
|
format!("all versions of {package} are unusable: {reason}")
|
||||||
|
} else {
|
||||||
|
format!("{package}{set} is unusable: {reason}",)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if set == &Range::full() {
|
||||||
|
format!("all versions of {package} are unusable")
|
||||||
|
} else {
|
||||||
|
format!("{package}{set} is unusable")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
External::UnusableDependencies(package, set, reason) => {
|
External::UnusableDependencies(package, set, reason) => {
|
||||||
if let Some(reason) = reason {
|
if let Some(reason) = reason {
|
||||||
if matches!(package, PubGrubPackage::Root(_)) {
|
if matches!(package, PubGrubPackage::Root(_)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue