mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-08 05:45:00 +00:00
Use universal resolution in uv lock
(#3969)
## Summary Wires up the optional markers in resolution, and adds respecting-the-markers to `Lock:: to_resolution`.
This commit is contained in:
parent
c500b78936
commit
a23ca5bab7
10 changed files with 195 additions and 54 deletions
|
@ -12,15 +12,18 @@ pub struct PythonRequirement {
|
|||
}
|
||||
|
||||
impl PythonRequirement {
|
||||
pub fn new(interpreter: &Interpreter, target: &StringVersion) -> Self {
|
||||
pub fn from_marker_environment(interpreter: &Interpreter, env: &MarkerEnvironment) -> Self {
|
||||
Self {
|
||||
installed: interpreter.python_full_version().clone(),
|
||||
target: target.clone(),
|
||||
target: env.python_full_version().clone(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_marker_environment(interpreter: &Interpreter, env: &MarkerEnvironment) -> Self {
|
||||
Self::new(interpreter, env.python_full_version())
|
||||
pub fn from_interpreter(interpreter: &Interpreter) -> Self {
|
||||
Self {
|
||||
installed: interpreter.python_full_version().clone(),
|
||||
target: interpreter.python_full_version().clone(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Return the installed version of Python.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue