Fork when minimum Python version increases (#8628)

## Summary

This is a re-implementation of
https://github.com/astral-sh/uv/pull/4712, though is now seemingly much
simpler. This issue keeps coming up, and users have a workaround with
`tool.uv.environments`, but it's really a bug in the resolver.

Closes https://github.com/astral-sh/uv/issues/4668.
This commit is contained in:
Charlie Marsh
2024-10-28 09:48:04 -04:00
committed by GitHub
parent 635223ef00
commit bfa84cd1ab
4 changed files with 131 additions and 17 deletions
@@ -71,6 +71,12 @@ impl PythonRequirement {
})
}
/// Returns `true` if the minimum version of Python required by the target is greater than the
/// installed version.
pub fn raises(&self, target: &RequiresPythonRange) -> bool {
target.lower() > self.target.range().lower()
}
/// Return the exact version of Python.
pub fn exact(&self) -> &Version {
&self.exact