mirror of https://github.com/astral-sh/uv
Rename from `Lowered` to `Canonical` (#9447)
By request: https://github.com/astral-sh/uv/pull/9341#pullrequestreview-2460979421.
This commit is contained in:
parent
7a0a5a806d
commit
8aeaf98f59
|
|
@ -27,8 +27,8 @@ use url::Url;
|
|||
|
||||
use cursor::Cursor;
|
||||
pub use marker::{
|
||||
ContainsMarkerTree, ExtraMarkerTree, ExtraOperator, InMarkerTree, LoweredMarkerValueExtra,
|
||||
LoweredMarkerValueString, LoweredMarkerValueVersion, MarkerEnvironment,
|
||||
CanonicalMarkerValueExtra, CanonicalMarkerValueString, CanonicalMarkerValueVersion,
|
||||
ContainsMarkerTree, ExtraMarkerTree, ExtraOperator, InMarkerTree, MarkerEnvironment,
|
||||
MarkerEnvironmentBuilder, MarkerExpression, MarkerOperator, MarkerTree, MarkerTreeContents,
|
||||
MarkerTreeKind, MarkerValue, MarkerValueExtra, MarkerValueString, MarkerValueVersion,
|
||||
MarkerWarningKind, StringMarkerTree, StringVersion, VersionMarkerTree,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ use uv_pep440::{release_specifier_to_range, Operator, Version, VersionSpecifier}
|
|||
use version_ranges::Ranges;
|
||||
|
||||
use crate::marker::lowering::{
|
||||
LoweredMarkerValueExtra, LoweredMarkerValueString, LoweredMarkerValueVersion,
|
||||
CanonicalMarkerValueExtra, CanonicalMarkerValueString, CanonicalMarkerValueVersion,
|
||||
};
|
||||
use crate::marker::MarkerValueExtra;
|
||||
use crate::ExtraOperator;
|
||||
|
|
@ -162,18 +162,18 @@ impl InternerGuard<'_> {
|
|||
// to disjoint version ranges.
|
||||
MarkerExpression::Version { key, specifier } => match key {
|
||||
MarkerValueVersion::ImplementationVersion => (
|
||||
Variable::Version(LoweredMarkerValueVersion::ImplementationVersion),
|
||||
Variable::Version(CanonicalMarkerValueVersion::ImplementationVersion),
|
||||
Edges::from_specifier(specifier),
|
||||
),
|
||||
MarkerValueVersion::PythonFullVersion => (
|
||||
Variable::Version(LoweredMarkerValueVersion::PythonFullVersion),
|
||||
Variable::Version(CanonicalMarkerValueVersion::PythonFullVersion),
|
||||
Edges::from_specifier(specifier),
|
||||
),
|
||||
// Normalize `python_version` markers to `python_full_version` nodes.
|
||||
MarkerValueVersion::PythonVersion => {
|
||||
match python_version_to_full_version(normalize_specifier(specifier)) {
|
||||
Ok(specifier) => (
|
||||
Variable::Version(LoweredMarkerValueVersion::PythonFullVersion),
|
||||
Variable::Version(CanonicalMarkerValueVersion::PythonFullVersion),
|
||||
Edges::from_specifier(specifier),
|
||||
),
|
||||
Err(node) => return node,
|
||||
|
|
@ -188,18 +188,18 @@ impl InternerGuard<'_> {
|
|||
negated,
|
||||
} => match key {
|
||||
MarkerValueVersion::ImplementationVersion => (
|
||||
Variable::Version(LoweredMarkerValueVersion::ImplementationVersion),
|
||||
Variable::Version(CanonicalMarkerValueVersion::ImplementationVersion),
|
||||
Edges::from_versions(&versions, negated),
|
||||
),
|
||||
MarkerValueVersion::PythonFullVersion => (
|
||||
Variable::Version(LoweredMarkerValueVersion::PythonFullVersion),
|
||||
Variable::Version(CanonicalMarkerValueVersion::PythonFullVersion),
|
||||
Edges::from_versions(&versions, negated),
|
||||
),
|
||||
// Normalize `python_version` markers to `python_full_version` nodes.
|
||||
MarkerValueVersion::PythonVersion => {
|
||||
match Edges::from_python_versions(versions, negated) {
|
||||
Ok(edges) => (
|
||||
Variable::Version(LoweredMarkerValueVersion::PythonFullVersion),
|
||||
Variable::Version(CanonicalMarkerValueVersion::PythonFullVersion),
|
||||
edges,
|
||||
),
|
||||
Err(node) => return node,
|
||||
|
|
@ -275,14 +275,14 @@ impl InternerGuard<'_> {
|
|||
name: MarkerValueExtra::Extra(extra),
|
||||
operator: ExtraOperator::Equal,
|
||||
} => (
|
||||
Variable::Extra(LoweredMarkerValueExtra::Extra(extra)),
|
||||
Variable::Extra(CanonicalMarkerValueExtra::Extra(extra)),
|
||||
Edges::from_bool(true),
|
||||
),
|
||||
MarkerExpression::Extra {
|
||||
name: MarkerValueExtra::Extra(extra),
|
||||
operator: ExtraOperator::NotEqual,
|
||||
} => (
|
||||
Variable::Extra(LoweredMarkerValueExtra::Extra(extra)),
|
||||
Variable::Extra(CanonicalMarkerValueExtra::Extra(extra)),
|
||||
Edges::from_bool(false),
|
||||
),
|
||||
// Invalid extras are always `false`.
|
||||
|
|
@ -443,7 +443,7 @@ impl InternerGuard<'_> {
|
|||
// Look for a `python_full_version` expression, otherwise
|
||||
// we recursively simplify.
|
||||
let Node {
|
||||
var: Variable::Version(LoweredMarkerValueVersion::PythonFullVersion),
|
||||
var: Variable::Version(CanonicalMarkerValueVersion::PythonFullVersion),
|
||||
children: Edges::Version { ref edges },
|
||||
} = node
|
||||
else {
|
||||
|
|
@ -516,7 +516,7 @@ impl InternerGuard<'_> {
|
|||
return NodeId::FALSE;
|
||||
}
|
||||
if matches!(i, NodeId::TRUE) {
|
||||
let var = Variable::Version(LoweredMarkerValueVersion::PythonFullVersion);
|
||||
let var = Variable::Version(CanonicalMarkerValueVersion::PythonFullVersion);
|
||||
let edges = Edges::Version {
|
||||
edges: Edges::from_range(&py_range),
|
||||
};
|
||||
|
|
@ -525,7 +525,7 @@ impl InternerGuard<'_> {
|
|||
|
||||
let node = self.shared.node(i);
|
||||
let Node {
|
||||
var: Variable::Version(LoweredMarkerValueVersion::PythonFullVersion),
|
||||
var: Variable::Version(CanonicalMarkerValueVersion::PythonFullVersion),
|
||||
children: Edges::Version { ref edges },
|
||||
} = node
|
||||
else {
|
||||
|
|
@ -621,26 +621,26 @@ pub(crate) enum Variable {
|
|||
///
|
||||
/// This is the highest order variable as it typically contains the most complex
|
||||
/// ranges, allowing us to merge ranges at the top-level.
|
||||
Version(LoweredMarkerValueVersion),
|
||||
Version(CanonicalMarkerValueVersion),
|
||||
/// A string marker, such as `os_name`.
|
||||
String(LoweredMarkerValueString),
|
||||
String(CanonicalMarkerValueString),
|
||||
/// A variable representing a `<key> in <value>` expression for a particular
|
||||
/// string marker and value.
|
||||
In {
|
||||
key: LoweredMarkerValueString,
|
||||
key: CanonicalMarkerValueString,
|
||||
value: String,
|
||||
},
|
||||
/// A variable representing a `<value> in <key>` expression for a particular
|
||||
/// string marker and value.
|
||||
Contains {
|
||||
key: LoweredMarkerValueString,
|
||||
key: CanonicalMarkerValueString,
|
||||
value: String,
|
||||
},
|
||||
/// A variable representing the existence or absence of a given extra.
|
||||
///
|
||||
/// We keep extras at the leaves of the tree, so when simplifying extras we can
|
||||
/// trivially remove the leaves without having to reconstruct the entire tree.
|
||||
Extra(LoweredMarkerValueExtra),
|
||||
Extra(CanonicalMarkerValueExtra),
|
||||
}
|
||||
|
||||
/// A decision node in an Algebraic Decision Diagram.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::sync::Arc;
|
|||
|
||||
use uv_pep440::{Version, VersionParseError};
|
||||
|
||||
use crate::{LoweredMarkerValueString, LoweredMarkerValueVersion, StringVersion};
|
||||
use crate::{CanonicalMarkerValueString, CanonicalMarkerValueVersion, StringVersion};
|
||||
|
||||
/// The marker values for a python interpreter, normally the current one
|
||||
///
|
||||
|
|
@ -33,28 +33,28 @@ struct MarkerEnvironmentInner {
|
|||
|
||||
impl MarkerEnvironment {
|
||||
/// Returns of the PEP 440 version typed value of the key in the current environment
|
||||
pub fn get_version(&self, key: LoweredMarkerValueVersion) -> &Version {
|
||||
pub fn get_version(&self, key: CanonicalMarkerValueVersion) -> &Version {
|
||||
match key {
|
||||
LoweredMarkerValueVersion::ImplementationVersion => {
|
||||
CanonicalMarkerValueVersion::ImplementationVersion => {
|
||||
&self.implementation_version().version
|
||||
}
|
||||
LoweredMarkerValueVersion::PythonFullVersion => &self.python_full_version().version,
|
||||
CanonicalMarkerValueVersion::PythonFullVersion => &self.python_full_version().version,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns of the stringly typed value of the key in the current environment
|
||||
pub fn get_string(&self, key: LoweredMarkerValueString) -> &str {
|
||||
pub fn get_string(&self, key: CanonicalMarkerValueString) -> &str {
|
||||
match key {
|
||||
LoweredMarkerValueString::ImplementationName => self.implementation_name(),
|
||||
LoweredMarkerValueString::OsName => self.os_name(),
|
||||
LoweredMarkerValueString::PlatformMachine => self.platform_machine(),
|
||||
LoweredMarkerValueString::PlatformPythonImplementation => {
|
||||
CanonicalMarkerValueString::ImplementationName => self.implementation_name(),
|
||||
CanonicalMarkerValueString::OsName => self.os_name(),
|
||||
CanonicalMarkerValueString::PlatformMachine => self.platform_machine(),
|
||||
CanonicalMarkerValueString::PlatformPythonImplementation => {
|
||||
self.platform_python_implementation()
|
||||
}
|
||||
LoweredMarkerValueString::PlatformRelease => self.platform_release(),
|
||||
LoweredMarkerValueString::PlatformSystem => self.platform_system(),
|
||||
LoweredMarkerValueString::PlatformVersion => self.platform_version(),
|
||||
LoweredMarkerValueString::SysPlatform => self.sys_platform(),
|
||||
CanonicalMarkerValueString::PlatformRelease => self.platform_release(),
|
||||
CanonicalMarkerValueString::PlatformSystem => self.platform_system(),
|
||||
CanonicalMarkerValueString::PlatformVersion => self.platform_version(),
|
||||
CanonicalMarkerValueString::SysPlatform => self.sys_platform(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@ use crate::{MarkerValueExtra, MarkerValueString, MarkerValueVersion};
|
|||
/// Those environment markers with a PEP 440 version as value such as `python_version`
|
||||
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
|
||||
#[allow(clippy::enum_variant_names)]
|
||||
pub enum LoweredMarkerValueVersion {
|
||||
pub enum CanonicalMarkerValueVersion {
|
||||
/// `implementation_version`
|
||||
ImplementationVersion,
|
||||
/// `python_full_version`
|
||||
PythonFullVersion,
|
||||
}
|
||||
|
||||
impl Display for LoweredMarkerValueVersion {
|
||||
impl Display for CanonicalMarkerValueVersion {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::ImplementationVersion => f.write_str("implementation_version"),
|
||||
|
|
@ -23,18 +23,18 @@ impl Display for LoweredMarkerValueVersion {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<LoweredMarkerValueVersion> for MarkerValueVersion {
|
||||
fn from(value: LoweredMarkerValueVersion) -> Self {
|
||||
impl From<CanonicalMarkerValueVersion> for MarkerValueVersion {
|
||||
fn from(value: CanonicalMarkerValueVersion) -> Self {
|
||||
match value {
|
||||
LoweredMarkerValueVersion::ImplementationVersion => Self::ImplementationVersion,
|
||||
LoweredMarkerValueVersion::PythonFullVersion => Self::PythonFullVersion,
|
||||
CanonicalMarkerValueVersion::ImplementationVersion => Self::ImplementationVersion,
|
||||
CanonicalMarkerValueVersion::PythonFullVersion => Self::PythonFullVersion,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Those environment markers with an arbitrary string as value such as `sys_platform`
|
||||
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
|
||||
pub enum LoweredMarkerValueString {
|
||||
pub enum CanonicalMarkerValueString {
|
||||
/// `implementation_name`
|
||||
ImplementationName,
|
||||
/// `os_name`
|
||||
|
|
@ -54,7 +54,7 @@ pub enum LoweredMarkerValueString {
|
|||
SysPlatform,
|
||||
}
|
||||
|
||||
impl From<MarkerValueString> for LoweredMarkerValueString {
|
||||
impl From<MarkerValueString> for CanonicalMarkerValueString {
|
||||
fn from(value: MarkerValueString) -> Self {
|
||||
match value {
|
||||
MarkerValueString::ImplementationName => Self::ImplementationName,
|
||||
|
|
@ -77,24 +77,24 @@ impl From<MarkerValueString> for LoweredMarkerValueString {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<LoweredMarkerValueString> for MarkerValueString {
|
||||
fn from(value: LoweredMarkerValueString) -> Self {
|
||||
impl From<CanonicalMarkerValueString> for MarkerValueString {
|
||||
fn from(value: CanonicalMarkerValueString) -> Self {
|
||||
match value {
|
||||
LoweredMarkerValueString::ImplementationName => Self::ImplementationName,
|
||||
LoweredMarkerValueString::OsName => Self::OsName,
|
||||
LoweredMarkerValueString::PlatformMachine => Self::PlatformMachine,
|
||||
LoweredMarkerValueString::PlatformPythonImplementation => {
|
||||
CanonicalMarkerValueString::ImplementationName => Self::ImplementationName,
|
||||
CanonicalMarkerValueString::OsName => Self::OsName,
|
||||
CanonicalMarkerValueString::PlatformMachine => Self::PlatformMachine,
|
||||
CanonicalMarkerValueString::PlatformPythonImplementation => {
|
||||
Self::PlatformPythonImplementation
|
||||
}
|
||||
LoweredMarkerValueString::PlatformRelease => Self::PlatformRelease,
|
||||
LoweredMarkerValueString::PlatformSystem => Self::PlatformSystem,
|
||||
LoweredMarkerValueString::PlatformVersion => Self::PlatformVersion,
|
||||
LoweredMarkerValueString::SysPlatform => Self::SysPlatform,
|
||||
CanonicalMarkerValueString::PlatformRelease => Self::PlatformRelease,
|
||||
CanonicalMarkerValueString::PlatformSystem => Self::PlatformSystem,
|
||||
CanonicalMarkerValueString::PlatformVersion => Self::PlatformVersion,
|
||||
CanonicalMarkerValueString::SysPlatform => Self::SysPlatform,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for LoweredMarkerValueString {
|
||||
impl Display for CanonicalMarkerValueString {
|
||||
/// Normalizes deprecated names to the proper ones
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
|
|
@ -112,12 +112,12 @@ impl Display for LoweredMarkerValueString {
|
|||
|
||||
/// The [`ExtraName`] value used in `extra` markers.
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
|
||||
pub enum LoweredMarkerValueExtra {
|
||||
pub enum CanonicalMarkerValueExtra {
|
||||
/// A valid [`ExtraName`].
|
||||
Extra(ExtraName),
|
||||
}
|
||||
|
||||
impl LoweredMarkerValueExtra {
|
||||
impl CanonicalMarkerValueExtra {
|
||||
/// Returns the [`ExtraName`] value.
|
||||
pub fn extra(&self) -> &ExtraName {
|
||||
match self {
|
||||
|
|
@ -126,15 +126,15 @@ impl LoweredMarkerValueExtra {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<LoweredMarkerValueExtra> for MarkerValueExtra {
|
||||
fn from(value: LoweredMarkerValueExtra) -> Self {
|
||||
impl From<CanonicalMarkerValueExtra> for MarkerValueExtra {
|
||||
fn from(value: CanonicalMarkerValueExtra) -> Self {
|
||||
match value {
|
||||
LoweredMarkerValueExtra::Extra(extra) => Self::Extra(extra),
|
||||
CanonicalMarkerValueExtra::Extra(extra) => Self::Extra(extra),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for LoweredMarkerValueExtra {
|
||||
impl Display for CanonicalMarkerValueExtra {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Extra(extra) => extra.fmt(f),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ mod simplify;
|
|||
mod tree;
|
||||
|
||||
pub use environment::{MarkerEnvironment, MarkerEnvironmentBuilder};
|
||||
pub use lowering::{LoweredMarkerValueExtra, LoweredMarkerValueString, LoweredMarkerValueVersion};
|
||||
pub use lowering::{
|
||||
CanonicalMarkerValueExtra, CanonicalMarkerValueString, CanonicalMarkerValueVersion,
|
||||
};
|
||||
pub use tree::{
|
||||
ContainsMarkerTree, ExtraMarkerTree, ExtraOperator, InMarkerTree, MarkerExpression,
|
||||
MarkerOperator, MarkerTree, MarkerTreeContents, MarkerTreeDebugGraph, MarkerTreeKind,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ use super::algebra::{Edges, NodeId, Variable, INTERNER};
|
|||
use super::simplify;
|
||||
use crate::cursor::Cursor;
|
||||
use crate::marker::lowering::{
|
||||
LoweredMarkerValueExtra, LoweredMarkerValueString, LoweredMarkerValueVersion,
|
||||
CanonicalMarkerValueExtra, CanonicalMarkerValueString, CanonicalMarkerValueVersion,
|
||||
};
|
||||
use crate::marker::parse;
|
||||
use crate::{
|
||||
|
|
@ -1270,13 +1270,13 @@ pub enum MarkerTreeKind<'a> {
|
|||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
pub struct VersionMarkerTree<'a> {
|
||||
id: NodeId,
|
||||
key: LoweredMarkerValueVersion,
|
||||
key: CanonicalMarkerValueVersion,
|
||||
map: &'a [(Ranges<Version>, NodeId)],
|
||||
}
|
||||
|
||||
impl VersionMarkerTree<'_> {
|
||||
/// The key for this node.
|
||||
pub fn key(&self) -> LoweredMarkerValueVersion {
|
||||
pub fn key(&self) -> CanonicalMarkerValueVersion {
|
||||
self.key
|
||||
}
|
||||
|
||||
|
|
@ -1306,13 +1306,13 @@ impl Ord for VersionMarkerTree<'_> {
|
|||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
pub struct StringMarkerTree<'a> {
|
||||
id: NodeId,
|
||||
key: LoweredMarkerValueString,
|
||||
key: CanonicalMarkerValueString,
|
||||
map: &'a [(Ranges<String>, NodeId)],
|
||||
}
|
||||
|
||||
impl StringMarkerTree<'_> {
|
||||
/// The key for this node.
|
||||
pub fn key(&self) -> LoweredMarkerValueString {
|
||||
pub fn key(&self) -> CanonicalMarkerValueString {
|
||||
self.key
|
||||
}
|
||||
|
||||
|
|
@ -1341,7 +1341,7 @@ impl Ord for StringMarkerTree<'_> {
|
|||
/// A string marker node with the `in` operator, such as `os_name in 'WindowsLinux'`.
|
||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
pub struct InMarkerTree<'a> {
|
||||
key: LoweredMarkerValueString,
|
||||
key: CanonicalMarkerValueString,
|
||||
value: &'a str,
|
||||
high: NodeId,
|
||||
low: NodeId,
|
||||
|
|
@ -1349,7 +1349,7 @@ pub struct InMarkerTree<'a> {
|
|||
|
||||
impl InMarkerTree<'_> {
|
||||
/// The key (LHS) for this expression.
|
||||
pub fn key(&self) -> LoweredMarkerValueString {
|
||||
pub fn key(&self) -> CanonicalMarkerValueString {
|
||||
self.key
|
||||
}
|
||||
|
||||
|
|
@ -1391,7 +1391,7 @@ impl Ord for InMarkerTree<'_> {
|
|||
/// A string marker node with inverse of the `in` operator, such as `'nux' in os_name`.
|
||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
pub struct ContainsMarkerTree<'a> {
|
||||
key: LoweredMarkerValueString,
|
||||
key: CanonicalMarkerValueString,
|
||||
value: &'a str,
|
||||
high: NodeId,
|
||||
low: NodeId,
|
||||
|
|
@ -1399,7 +1399,7 @@ pub struct ContainsMarkerTree<'a> {
|
|||
|
||||
impl ContainsMarkerTree<'_> {
|
||||
/// The key (LHS) for this expression.
|
||||
pub fn key(&self) -> LoweredMarkerValueString {
|
||||
pub fn key(&self) -> CanonicalMarkerValueString {
|
||||
self.key
|
||||
}
|
||||
|
||||
|
|
@ -1441,14 +1441,14 @@ impl Ord for ContainsMarkerTree<'_> {
|
|||
/// A node representing the existence or absence of a given extra, such as `extra == 'bar'`.
|
||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
pub struct ExtraMarkerTree<'a> {
|
||||
name: &'a LoweredMarkerValueExtra,
|
||||
name: &'a CanonicalMarkerValueExtra,
|
||||
high: NodeId,
|
||||
low: NodeId,
|
||||
}
|
||||
|
||||
impl ExtraMarkerTree<'_> {
|
||||
/// Returns the name of the extra in this expression.
|
||||
pub fn name(&self) -> &LoweredMarkerValueExtra {
|
||||
pub fn name(&self) -> &CanonicalMarkerValueExtra {
|
||||
self.name
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pubgrub::Range;
|
||||
use uv_pep440::Version;
|
||||
use uv_pep508::{LoweredMarkerValueVersion, MarkerTree, MarkerTreeKind};
|
||||
use uv_pep508::{CanonicalMarkerValueVersion, MarkerTree, MarkerTreeKind};
|
||||
|
||||
use crate::requires_python::{LowerBound, RequiresPythonRange, UpperBound};
|
||||
|
||||
|
|
@ -10,14 +10,14 @@ pub(crate) fn requires_python(tree: &MarkerTree) -> Option<RequiresPythonRange>
|
|||
match tree.kind() {
|
||||
MarkerTreeKind::True | MarkerTreeKind::False => {}
|
||||
MarkerTreeKind::Version(marker) => match marker.key() {
|
||||
LoweredMarkerValueVersion::PythonFullVersion => {
|
||||
CanonicalMarkerValueVersion::PythonFullVersion => {
|
||||
for (range, tree) in marker.edges() {
|
||||
if !tree.is_false() {
|
||||
markers.push(range.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
LoweredMarkerValueVersion::ImplementationVersion => {
|
||||
CanonicalMarkerValueVersion::ImplementationVersion => {
|
||||
for (_, tree) in marker.edges() {
|
||||
collect_python_markers(&tree, markers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -587,8 +587,8 @@ impl ResolverOutput {
|
|||
marker_env: &MarkerEnvironment,
|
||||
) -> Result<MarkerTree, Box<ParsedUrlError>> {
|
||||
use uv_pep508::{
|
||||
LoweredMarkerValueString, LoweredMarkerValueVersion, MarkerExpression, MarkerOperator,
|
||||
MarkerTree,
|
||||
CanonicalMarkerValueString, CanonicalMarkerValueVersion, MarkerExpression,
|
||||
MarkerOperator, MarkerTree,
|
||||
};
|
||||
|
||||
/// A subset of the possible marker values.
|
||||
|
|
@ -598,8 +598,8 @@ impl ResolverOutput {
|
|||
/// values based on the current marker environment.
|
||||
#[derive(Debug, Eq, Hash, PartialEq)]
|
||||
enum MarkerParam {
|
||||
Version(LoweredMarkerValueVersion),
|
||||
String(LoweredMarkerValueString),
|
||||
Version(CanonicalMarkerValueVersion),
|
||||
String(CanonicalMarkerValueString),
|
||||
}
|
||||
|
||||
/// Add all marker parameters from the given tree to the given set.
|
||||
|
|
|
|||
Loading…
Reference in New Issue