From b177bd026d47f51ee89fbb2860a8e400787b745e Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Fri, 22 Mar 2024 13:13:26 -0400 Subject: [PATCH] pep508: expose lower level marker env routines These are useful for converting lower level marker values types to their corresponding values from a marker environment. We'll use these for generating marker expressions based on both the dependency graph and the current marker environment. --- crates/pep508-rs/src/marker.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/pep508-rs/src/marker.rs b/crates/pep508-rs/src/marker.rs index f2553c75a..943c4cc8c 100644 --- a/crates/pep508-rs/src/marker.rs +++ b/crates/pep508-rs/src/marker.rs @@ -377,7 +377,7 @@ pub struct MarkerEnvironment { impl MarkerEnvironment { /// Returns of the PEP 440 version typed value of the key in the current environment - fn get_version(&self, key: &MarkerValueVersion) -> &Version { + pub fn get_version(&self, key: &MarkerValueVersion) -> &Version { match key { MarkerValueVersion::ImplementationVersion => &self.implementation_version.version, MarkerValueVersion::PythonFullVersion => &self.python_full_version.version, @@ -386,7 +386,7 @@ impl MarkerEnvironment { } /// Returns of the stringly typed value of the key in the current environment - fn get_string(&self, key: &MarkerValueString) -> &str { + pub fn get_string(&self, key: &MarkerValueString) -> &str { match key { MarkerValueString::ImplementationName => &self.implementation_name, MarkerValueString::OsName | MarkerValueString::OsNameDeprecated => &self.os_name,