mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Simplify supported environments when comparing to lockfile (#7894)
## Summary If a supported environment includes a Python marker, we don't simplify it out, despite _storing_ the simplified markers. This PR modifies the validation code to compare simplified to simplified markers. Closes https://github.com/astral-sh/uv/issues/7876.
This commit is contained in:
parent
005bb235f0
commit
8962bcb028
3 changed files with 152 additions and 20 deletions
|
@ -524,10 +524,17 @@ impl Lock {
|
|||
pub fn simplified_supported_environments(&self) -> Vec<MarkerTree> {
|
||||
self.supported_environments()
|
||||
.iter()
|
||||
.map(|marker| self.requires_python.simplify_markers(marker.clone()))
|
||||
.cloned()
|
||||
.map(|marker| self.simplify_environment(marker))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Simplify the given marker environment with respect to the lockfile's
|
||||
/// `requires-python` setting.
|
||||
pub fn simplify_environment(&self, marker: MarkerTree) -> MarkerTree {
|
||||
self.requires_python.simplify_markers(marker)
|
||||
}
|
||||
|
||||
/// If this lockfile was built from a forking resolution with non-identical forks, return the
|
||||
/// markers of those forks, otherwise `None`.
|
||||
pub fn fork_markers(&self) -> &[MarkerTree] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue