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:
Charlie Marsh 2024-06-02 21:33:18 -04:00 committed by GitHub
parent c500b78936
commit a23ca5bab7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 195 additions and 54 deletions

View file

@ -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.