diff --git a/crates/uv-resolver/src/resolution/graph.rs b/crates/uv-resolver/src/resolution/graph.rs index 16e3119596f20..47b6ae779a474 100644 --- a/crates/uv-resolver/src/resolution/graph.rs +++ b/crates/uv-resolver/src/resolution/graph.rs @@ -1,7 +1,7 @@ use indexmap::IndexSet; use petgraph::{ - graph::{Graph, NodeIndex}, - Directed, Direction, + Directed, + Direction, graph::{Graph, NodeIndex}, }; use pubgrub::Range; use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet}; @@ -18,6 +18,10 @@ use uv_distribution::Metadata; use uv_git::GitResolver; use uv_normalize::{ExtraName, GroupName, PackageName}; +use crate::{ + InMemoryIndex, MetadataResponse, Options, PythonRequirement, RequiresPython, ResolveError, + ResolverMarkers, VersionsResponse, +}; use crate::pins::FilePins; use crate::preferences::Preferences; use crate::python_requirement::PythonTarget; @@ -25,10 +29,6 @@ use crate::redirect::url_to_precise; use crate::resolution::AnnotatedDist; use crate::resolution_mode::ResolutionStrategy; use crate::resolver::{Resolution, ResolutionDependencyEdge, ResolutionPackage}; -use crate::{ - InMemoryIndex, MetadataResponse, Options, PythonRequirement, RequiresPython, ResolveError, - ResolverMarkers, VersionsResponse, -}; pub(crate) type MarkersForDistribution = FxHashMap<(Version, Option), Vec>; diff --git a/crates/uv-resolver/src/resolver/mod.rs b/crates/uv-resolver/src/resolver/mod.rs index 70e248aefddad..1ec7658ec8483 100644 --- a/crates/uv-resolver/src/resolver/mod.rs +++ b/crates/uv-resolver/src/resolver/mod.rs @@ -400,29 +400,6 @@ impl ResolverState bool { - // TODO(konsti): The edges being equal is not a requirement for the graph being equal. While - // an exact solution is too much here, we should ignore different in edges that point to - // nodes that are always installed. Example: root requires foo, root requires bar. bar - // forks, and one for the branches has bar -> foo while the other doesn't. The resolution - // is still the same graph since the presence or absence of the bar -> foo edge cannot - // change which packages and versions are installed. - self.nodes == other.nodes && self.edges == other.edges - } -} - impl ResolutionPackage { pub(crate) fn is_base(&self) -> bool { self.extra.is_none() && self.dev.is_none() diff --git a/crates/uv/tests/ecosystem.rs b/crates/uv/tests/ecosystem.rs index c301d216931dd..4d2429a76a2f5 100644 --- a/crates/uv/tests/ecosystem.rs +++ b/crates/uv/tests/ecosystem.rs @@ -33,9 +33,7 @@ fn packse() -> Result<()> { // Source: https://github.com/konstin/github-wikidata-bot/blob/8218d20985eb480cb8633026f9dabc9e5ec4b5e3/pyproject.toml #[test] fn github_wikidata_bot() -> Result<()> { - // TODO(charlie): This test became non-deterministic in https://github.com/astral-sh/uv/pull/6065. - // However, that fix is _correct_, and the non-determinism itself is an existing bug. - lock_ecosystem_package_non_deterministic("3.12", "github-wikidata-bot") + lock_ecosystem_package("3.12", "github-wikidata-bot") } // Source: https://github.com/psf/black/blob/9ff047a9575f105f659043f28573e1941e9cdfb3/pyproject.toml diff --git a/crates/uv/tests/lock.rs b/crates/uv/tests/lock.rs index 2cf2ee1b328c9..fe91eb45e821d 100644 --- a/crates/uv/tests/lock.rs +++ b/crates/uv/tests/lock.rs @@ -3626,19 +3626,17 @@ fn lock_python_version_marker_complement() -> Result<()> { ); }); - // TODO(charlie): This test became non-deterministic in https://github.com/astral-sh/uv/pull/6065. - // But that fix is correct, and the non-determinism itself is a bug. - // // Re-run with `--locked`. - // uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" - // success: false - // exit_code: 2 - // ----- stdout ----- - // - // ----- stderr ----- - // warning: `uv lock` is experimental and may change without warning - // Resolved 4 packages in [TIME] - // error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - // "###); + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: false + exit_code: 2 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 4 packages in [TIME] + error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. + "###); Ok(()) }