diff --git a/crates/pep508-rs/src/marker.rs b/crates/pep508-rs/src/marker.rs index 7b09d0aa1..f10b690c7 100644 --- a/crates/pep508-rs/src/marker.rs +++ b/crates/pep508-rs/src/marker.rs @@ -96,6 +96,8 @@ pub enum MarkerValueString { PlatformPythonImplementation, /// Deprecated `platform.python_implementation` from PlatformPythonImplementationDeprecated, + /// Deprecated `python_implementation` from + PythonImplementationDeprecated, /// `platform_release` PlatformRelease, /// `platform_system` @@ -119,9 +121,9 @@ impl Display for MarkerValueString { Self::PlatformMachine | Self::PlatformMachineDeprecated => { f.write_str("platform_machine") } - Self::PlatformPythonImplementation | Self::PlatformPythonImplementationDeprecated => { - f.write_str("platform_python_implementation") - } + Self::PlatformPythonImplementation + | Self::PlatformPythonImplementationDeprecated + | Self::PythonImplementationDeprecated => f.write_str("platform_python_implementation"), Self::PlatformRelease => f.write_str("platform_release"), Self::PlatformSystem => f.write_str("platform_system"), Self::PlatformVersion | Self::PlatformVersionDeprecated => { @@ -175,6 +177,9 @@ impl FromStr for MarkerValue { "platform.python_implementation" => { Self::MarkerEnvString(MarkerValueString::PlatformPythonImplementationDeprecated) } + "python_implementation" => { + Self::MarkerEnvString(MarkerValueString::PythonImplementationDeprecated) + } "platform_release" => Self::MarkerEnvString(MarkerValueString::PlatformRelease), "platform_system" => Self::MarkerEnvString(MarkerValueString::PlatformSystem), "platform_version" => Self::MarkerEnvString(MarkerValueString::PlatformVersion), @@ -389,7 +394,8 @@ impl MarkerEnvironment { &self.platform_machine } MarkerValueString::PlatformPythonImplementation - | MarkerValueString::PlatformPythonImplementationDeprecated => { + | MarkerValueString::PlatformPythonImplementationDeprecated + | MarkerValueString::PythonImplementationDeprecated => { &self.platform_python_implementation } MarkerValueString::PlatformRelease => &self.platform_release, @@ -1067,6 +1073,15 @@ impl MarkerTree { expression, ); } + MarkerValue::MarkerEnvString( + MarkerValueString::PythonImplementationDeprecated, + ) => { + reporter( + MarkerWarningKind::DeprecatedMarkerName, + "python_implementation is deprecated in favor of platform_python_implementation".to_string(), + expression, + ); + } MarkerValue::MarkerEnvString( MarkerValueString::PlatformVersionDeprecated, ) => {