mirror of https://github.com/astral-sh/uv
Include versions in the lockfile coherence error message (#12249)
This commit is contained in:
parent
0c352c68e9
commit
dfa5eed5ef
|
|
@ -2877,6 +2877,8 @@ impl PackageWire {
|
|||
if version != &wheel.filename.version {
|
||||
return Err(LockError::from(LockErrorKind::InconsistentVersions {
|
||||
name: self.id.name,
|
||||
version: version.clone(),
|
||||
wheel: wheel.clone(),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
@ -5171,10 +5173,14 @@ enum LockErrorKind {
|
|||
},
|
||||
/// A package has inconsistent versions in a single entry
|
||||
// Using name instead of id since the version in the id is part of the conflict.
|
||||
#[error("Locked package and file versions are inconsistent for `{name}`", name = name.cyan())]
|
||||
#[error("The entry for package `{name}` v{version} has wheel `{wheel_filename}` with inconsistent version: v{wheel_version} ", name = name.cyan(), wheel_filename = wheel.filename, wheel_version = wheel.filename.version)]
|
||||
InconsistentVersions {
|
||||
/// The name of the package with the inconsistent entry.
|
||||
name: PackageName,
|
||||
/// The version of the package with the inconsistent entry.
|
||||
version: Version,
|
||||
/// The wheel with the inconsistent version.
|
||||
wheel: Wheel,
|
||||
},
|
||||
#[error(
|
||||
"Found conflicting extras `{package1}[{extra1}]` \
|
||||
|
|
|
|||
|
|
@ -8549,7 +8549,7 @@ fn locked_version_coherence() -> Result<()> {
|
|||
|
||||
----- stderr -----
|
||||
error: Failed to parse `uv.lock`
|
||||
Caused by: Locked package and file versions are inconsistent for `iniconfig`
|
||||
Caused by: The entry for package `iniconfig` v1.0.0 has wheel `iniconfig-2.0.0-py3-none-any.whl` with inconsistent version: v2.0.0
|
||||
");
|
||||
|
||||
// Without `--locked`, we could fail or recreate the lockfile, currently, we fail.
|
||||
|
|
@ -8560,7 +8560,7 @@ fn locked_version_coherence() -> Result<()> {
|
|||
|
||||
----- stderr -----
|
||||
error: Failed to parse `uv.lock`
|
||||
Caused by: Locked package and file versions are inconsistent for `iniconfig`
|
||||
Caused by: The entry for package `iniconfig` v1.0.0 has wheel `iniconfig-2.0.0-py3-none-any.whl` with inconsistent version: v2.0.0
|
||||
");
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Reference in New Issue