diff --git a/Cargo.lock b/Cargo.lock index 709fc5c9ce63..cf2a05ece7ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2706,7 +2706,7 @@ dependencies = [ [[package]] name = "pubgrub" version = "0.2.1" -source = "git+https://github.com/astral-sh/pubgrub?rev=3f0ba760951ab0deeac874b98bb18fc90103fcf7#3f0ba760951ab0deeac874b98bb18fc90103fcf7" +source = "git+https://github.com/astral-sh/pubgrub?rev=2fac39371a47e7cb821e510aaa4de25405413d29#2fac39371a47e7cb821e510aaa4de25405413d29" dependencies = [ "indexmap", "log", diff --git a/Cargo.toml b/Cargo.toml index e3213201b9bc..04f713fe21dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,7 +109,7 @@ pathdiff = { version = "0.2.1" } petgraph = { version = "0.6.4" } platform-info = { version = "2.0.2" } proc-macro2 = { version = "1.0.86" } -pubgrub = { git = "https://github.com/astral-sh/pubgrub", rev = "3f0ba760951ab0deeac874b98bb18fc90103fcf7" } +pubgrub = { git = "https://github.com/astral-sh/pubgrub", rev = "2fac39371a47e7cb821e510aaa4de25405413d29" } pyo3 = { version = "0.21.0" } pyo3-log = { version = "0.10.0" } quote = { version = "1.0.36" } diff --git a/crates/uv-resolver/src/candidate_selector.rs b/crates/uv-resolver/src/candidate_selector.rs index f42dc433d9f1..7b896b3f87a5 100644 --- a/crates/uv-resolver/src/candidate_selector.rs +++ b/crates/uv-resolver/src/candidate_selector.rs @@ -1,5 +1,5 @@ use itertools::Itertools; -use pubgrub::range::Range; +use pubgrub::Range; use std::fmt::{Display, Formatter}; use tracing::debug; diff --git a/crates/uv-resolver/src/dependency_provider.rs b/crates/uv-resolver/src/dependency_provider.rs index d9cc4c402ee3..0f85d1114688 100644 --- a/crates/uv-resolver/src/dependency_provider.rs +++ b/crates/uv-resolver/src/dependency_provider.rs @@ -1,7 +1,6 @@ use std::convert::Infallible; -use pubgrub::range::Range; -use pubgrub::solver::{Dependencies, DependencyProvider}; +use pubgrub::{Dependencies, DependencyProvider, Range}; use pep440_rs::Version; diff --git a/crates/uv-resolver/src/error.rs b/crates/uv-resolver/src/error.rs index 4826ab535e8c..5bc3c60aee25 100644 --- a/crates/uv-resolver/src/error.rs +++ b/crates/uv-resolver/src/error.rs @@ -2,8 +2,7 @@ use std::collections::{BTreeMap, BTreeSet}; use std::fmt::Formatter; use std::sync::Arc; -use pubgrub::range::Range; -use pubgrub::report::{DefaultStringReporter, DerivationTree, External, Reporter}; +use pubgrub::{DefaultStringReporter, DerivationTree, External, Range, Reporter}; use rustc_hash::FxHashMap; use distribution_types::{BuiltDist, IndexLocations, InstalledDist, SourceDist}; @@ -117,7 +116,7 @@ impl From> for ResolveError { /// A wrapper around [`pubgrub::error::NoSolutionError`] that displays a resolution failure report. #[derive(Debug)] pub struct NoSolutionError { - error: pubgrub::error::NoSolutionError, + error: pubgrub::NoSolutionError, available_versions: FxHashMap>, selector: CandidateSelector, python_requirement: PythonRequirement, @@ -141,7 +140,7 @@ impl NoSolutionError { } pub(crate) fn new( - error: pubgrub::error::NoSolutionError, + error: pubgrub::NoSolutionError, available_versions: FxHashMap>, selector: CandidateSelector, python_requirement: PythonRequirement, diff --git a/crates/uv-resolver/src/marker.rs b/crates/uv-resolver/src/marker.rs index e475f40ac670..64107534e221 100644 --- a/crates/uv-resolver/src/marker.rs +++ b/crates/uv-resolver/src/marker.rs @@ -3,7 +3,7 @@ use std::ops::Bound::{self, *}; use std::ops::RangeBounds; -use pubgrub::range::{Range as PubGrubRange, Range}; +use pubgrub::Range as PubGrubRange; use rustc_hash::FxHashMap; use pep440_rs::{Version, VersionSpecifier}; @@ -125,7 +125,7 @@ fn string_is_disjoint(this: &MarkerExpression, other: &MarkerExpression) -> bool true } -pub(crate) fn python_range(expr: &MarkerExpression) -> Option> { +pub(crate) fn python_range(expr: &MarkerExpression) -> Option> { match expr { MarkerExpression::Version { key: MarkerValueVersion::PythonFullVersion, @@ -331,7 +331,7 @@ pub(crate) fn normalize_all( MarkerTree::Expression(expr) if bound.is_some_and(|bound| { python_range(&expr).is_some_and(|supported_range| { - Range::from(bound.clone()).subset_of(&supported_range) + PubGrubRange::from(bound.clone()).subset_of(&supported_range) }) }) => { diff --git a/crates/uv-resolver/src/pubgrub/dependencies.rs b/crates/uv-resolver/src/pubgrub/dependencies.rs index 620a16eb6404..e3a795d4f46b 100644 --- a/crates/uv-resolver/src/pubgrub/dependencies.rs +++ b/crates/uv-resolver/src/pubgrub/dependencies.rs @@ -1,7 +1,7 @@ use std::iter; use itertools::Itertools; -use pubgrub::range::Range; +use pubgrub::Range; use tracing::warn; use pep440_rs::{Version, VersionSpecifiers}; diff --git a/crates/uv-resolver/src/pubgrub/priority.rs b/crates/uv-resolver/src/pubgrub/priority.rs index d424622a410f..6e63f5ad96e2 100644 --- a/crates/uv-resolver/src/pubgrub/priority.rs +++ b/crates/uv-resolver/src/pubgrub/priority.rs @@ -1,6 +1,6 @@ use std::cmp::Reverse; -use pubgrub::range::Range; +use pubgrub::Range; use rustc_hash::FxHashMap; use crate::fork_urls::ForkUrls; diff --git a/crates/uv-resolver/src/pubgrub/report.rs b/crates/uv-resolver/src/pubgrub/report.rs index d95a07adde02..9edd287d9109 100644 --- a/crates/uv-resolver/src/pubgrub/report.rs +++ b/crates/uv-resolver/src/pubgrub/report.rs @@ -6,10 +6,7 @@ use std::ops::Bound; use derivative::Derivative; use indexmap::IndexSet; use owo_colors::OwoColorize; -use pubgrub::range::Range; -use pubgrub::report::{DerivationTree, Derived, External, ReportFormatter}; -use pubgrub::term::Term; -use pubgrub::type_aliases::Map; +use pubgrub::{DerivationTree, Derived, External, Map, Range, ReportFormatter, Term}; use rustc_hash::FxHashMap; use distribution_types::IndexLocations; diff --git a/crates/uv-resolver/src/pubgrub/specifier.rs b/crates/uv-resolver/src/pubgrub/specifier.rs index 11805cb82352..ef8f27b83b5f 100644 --- a/crates/uv-resolver/src/pubgrub/specifier.rs +++ b/crates/uv-resolver/src/pubgrub/specifier.rs @@ -1,7 +1,7 @@ use std::ops::Bound; use itertools::Itertools; -use pubgrub::range::Range; +use pubgrub::Range; use thiserror::Error; use pep440_rs::{Operator, PreRelease, Version, VersionSpecifier, VersionSpecifiers}; diff --git a/crates/uv-resolver/src/requires_python.rs b/crates/uv-resolver/src/requires_python.rs index fb1217ef1708..19f40f4544c4 100644 --- a/crates/uv-resolver/src/requires_python.rs +++ b/crates/uv-resolver/src/requires_python.rs @@ -3,7 +3,7 @@ use std::collections::Bound; use std::ops::Deref; use itertools::Itertools; -use pubgrub::range::Range; +use pubgrub::Range; use distribution_filename::WheelFilename; use pep440_rs::{Operator, Version, VersionSpecifier, VersionSpecifiers}; diff --git a/crates/uv-resolver/src/resolver/batch_prefetch.rs b/crates/uv-resolver/src/resolver/batch_prefetch.rs index 67ed36f7f9a1..5716062b4e66 100644 --- a/crates/uv-resolver/src/resolver/batch_prefetch.rs +++ b/crates/uv-resolver/src/resolver/batch_prefetch.rs @@ -1,7 +1,7 @@ use std::cmp::min; use itertools::Itertools; -use pubgrub::range::Range; +use pubgrub::Range; use rustc_hash::FxHashMap; use tokio::sync::mpsc::Sender; use tracing::{debug, trace}; diff --git a/crates/uv-resolver/src/resolver/mod.rs b/crates/uv-resolver/src/resolver/mod.rs index 525473c66345..de41fcedaa6a 100644 --- a/crates/uv-resolver/src/resolver/mod.rs +++ b/crates/uv-resolver/src/resolver/mod.rs @@ -13,8 +13,7 @@ use dashmap::DashMap; use either::Either; use futures::{FutureExt, StreamExt}; use itertools::Itertools; -use pubgrub::range::Range; -use pubgrub::solver::{Incompatibility, State}; +use pubgrub::{Incompatibility, Range, State}; use rustc_hash::{FxHashMap, FxHashSet}; use tokio::sync::mpsc::{self, Receiver, Sender}; use tokio::sync::oneshot; @@ -1885,7 +1884,7 @@ impl ResolverState, + mut err: pubgrub::NoSolutionError, fork_urls: ForkUrls, markers: ResolverMarkers, visited: &FxHashSet, @@ -2245,7 +2244,7 @@ impl ForkState { let mut edges: FxHashSet = FxHashSet::default(); for (package, self_version) in &solution { for id in &self.pubgrub.incompatibilities[package] { - let pubgrub::solver::Kind::FromDependencyOf( + let pubgrub::Kind::FromDependencyOf( ref self_package, ref self_range, ref dependency_package,