Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct ordering semantics for narrowing upper-bounded Python requirements #7031

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions crates/uv-resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ pub use preferences::{Preference, PreferenceError, Preferences};
pub use prerelease::PrereleaseMode;
pub use pubgrub::{PubGrubSpecifier, PubGrubSpecifierError};
pub use python_requirement::PythonRequirement;
pub use requires_python::{
RequiresPython, RequiresPythonBound, RequiresPythonError, RequiresPythonRange,
};
pub use requires_python::{RequiresPython, RequiresPythonError, RequiresPythonRange};
pub use resolution::{AnnotationStyle, DisplayResolutionGraph, ResolutionGraph};
pub use resolution_mode::ResolutionMode;
pub use resolver::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Ok(
],
),
range: RequiresPythonRange(
RequiresPythonBound(
LowerBound(
Included(
"3.12",
),
),
RequiresPythonBound(
UpperBound(
Unbounded,
),
),
Expand Down
7 changes: 3 additions & 4 deletions crates/uv-resolver/src/marker.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::requires_python::RequiresPythonRange;
use crate::RequiresPythonBound;
use crate::requires_python::{LowerBound, RequiresPythonRange, UpperBound};
use pep440_rs::Version;
use pep508_rs::{MarkerTree, MarkerTreeKind, MarkerValueVersion};
use pubgrub::Range;
Expand Down Expand Up @@ -62,7 +61,7 @@ pub(crate) fn requires_python(tree: &MarkerTree) -> Option<RequiresPythonRange>
let (lower, upper) = range.bounding_range()?;

Some(RequiresPythonRange::new(
RequiresPythonBound::new(lower.cloned()),
RequiresPythonBound::new(upper.cloned()),
LowerBound::new(lower.cloned()),
UpperBound::new(upper.cloned()),
))
}
Loading
Loading