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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user