mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-18 19:21:46 +00:00
Enforce Requires-Python when syncing (#4068)
## Summary Ensures that we raise if the user attempts to use a Python version that wasn't included in the locked range. Closes https://github.com/astral-sh/uv/issues/4052.
This commit is contained in:
parent
642cef0dad
commit
0b6d5b37dc
4 changed files with 199 additions and 5 deletions
|
|
@ -113,6 +113,11 @@ impl Lock {
|
|||
&self.distributions
|
||||
}
|
||||
|
||||
/// Returns the supported Python version range for the lockfile, if present.
|
||||
pub fn requires_python(&self) -> Option<&VersionSpecifiers> {
|
||||
self.requires_python.as_ref()
|
||||
}
|
||||
|
||||
/// Convert the [`Lock`] to a [`Resolution`] using the given marker environment, tags, and root.
|
||||
pub fn to_resolution(
|
||||
&self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue