-
Notifications
You must be signed in to change notification settings - Fork 936
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
262678c
commit 7a119ee
Showing
8 changed files
with
33 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,31 @@ | ||
use pep440_rs::Version; | ||
use pep508_rs::MarkerEnvironment; | ||
use pep508_rs::{MarkerEnvironment, StringVersion}; | ||
use uv_interpreter::Interpreter; | ||
|
||
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
#[derive(Debug, Clone, Eq, PartialEq)] | ||
pub struct PythonRequirement { | ||
/// The installed version of Python. | ||
installed: Version, | ||
installed: StringVersion, | ||
/// The target version of Python; that is, the version of Python for which we are resolving | ||
/// dependencies. This is typically the same as the installed version, but may be different | ||
/// when specifying an alternate Python version for the resolution. | ||
target: Version, | ||
target: StringVersion, | ||
} | ||
|
||
impl PythonRequirement { | ||
pub fn new(interpreter: &Interpreter, markers: &MarkerEnvironment) -> Self { | ||
Self { | ||
installed: interpreter.python_version().clone(), | ||
target: markers.python_full_version.version.clone(), | ||
installed: interpreter.python_full_version().clone(), | ||
target: markers.python_full_version.clone(), | ||
} | ||
} | ||
|
||
/// Return the installed version of Python. | ||
pub fn installed(&self) -> &Version { | ||
pub fn installed(&self) -> &StringVersion { | ||
&self.installed | ||
} | ||
|
||
/// Return the target version of Python. | ||
pub fn target(&self) -> &Version { | ||
pub fn target(&self) -> &StringVersion { | ||
&self.target | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters