mirror of https://github.com/astral-sh/uv
Use constraints in trace rather than irrelevant requires-python (#9529)
This commit is contained in:
parent
58cf93a219
commit
950855877a
|
|
@ -1753,6 +1753,15 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
||||||
let mut marker = constraint.marker.clone();
|
let mut marker = constraint.marker.clone();
|
||||||
marker.and(requirement.marker.clone());
|
marker.and(requirement.marker.clone());
|
||||||
|
|
||||||
|
if marker.is_false() {
|
||||||
|
trace!(
|
||||||
|
"skipping {constraint} because of disjoint markers: `{}` vs. `{}`",
|
||||||
|
constraint.marker.try_to_string().unwrap(),
|
||||||
|
requirement.marker.try_to_string().unwrap(),
|
||||||
|
);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
Cow::Owned(Requirement {
|
Cow::Owned(Requirement {
|
||||||
name: constraint.name.clone(),
|
name: constraint.name.clone(),
|
||||||
extras: constraint.extras.clone(),
|
extras: constraint.extras.clone(),
|
||||||
|
|
@ -1768,17 +1777,21 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
||||||
let mut marker = constraint.marker.clone();
|
let mut marker = constraint.marker.clone();
|
||||||
marker.and(requirement.marker.clone());
|
marker.and(requirement.marker.clone());
|
||||||
|
|
||||||
|
if marker.is_false() {
|
||||||
|
trace!(
|
||||||
|
"skipping {constraint} because of disjoint markers: `{}` vs. `{}`",
|
||||||
|
constraint.marker.try_to_string().unwrap(),
|
||||||
|
requirement.marker.try_to_string().unwrap(),
|
||||||
|
);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
// Additionally, if the requirement is `requests ; sys_platform == 'darwin'`
|
// Additionally, if the requirement is `requests ; sys_platform == 'darwin'`
|
||||||
// and the constraint is `requests ; python_version == '3.6'`, the
|
// and the constraint is `requests ; python_version == '3.6'`, the
|
||||||
// constraint should only apply when _both_ markers are true.
|
// constraint should only apply when _both_ markers are true.
|
||||||
if marker.is_false() {
|
|
||||||
trace!("skipping {constraint} because of Requires-Python: {requires_python}");
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
if python_marker.is_disjoint(&marker) {
|
if python_marker.is_disjoint(&marker) {
|
||||||
trace!(
|
trace!(
|
||||||
"skipping constraint {requirement} because of Requires-Python: {requires_python}",
|
"skipping constraint {requirement} because of Requires-Python: {requires_python}"
|
||||||
requires_python = python_requirement.target(),
|
|
||||||
);
|
);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue