1
- use petgraph:: { Directed , Graph } ;
2
-
3
1
use uv_distribution_filename:: DistExtension ;
4
2
use uv_normalize:: { ExtraName , GroupName , PackageName } ;
5
3
use uv_pep508:: MarkerTree ;
@@ -8,23 +6,27 @@ use uv_pypi_types::{HashDigest, RequirementSource};
8
6
use crate :: { BuiltDist , Diagnostic , Dist , Name , ResolvedDist , SourceDist } ;
9
7
10
8
/// A set of packages pinned at specific versions.
9
+ ///
10
+ /// This is similar to [`ResolverOutput`], but represents a resolution for a subset of all
11
+ /// marker environments. For example, the resolution is guaranteed to contain at most one version
12
+ /// for a given package.
11
13
#[ derive( Debug , Default , Clone ) ]
12
14
pub struct Resolution {
13
- graph : Graph < Node , Edge , Directed > ,
15
+ graph : petgraph :: graph :: DiGraph < Node , Edge > ,
14
16
diagnostics : Vec < ResolutionDiagnostic > ,
15
17
}
16
18
17
19
impl Resolution {
18
20
/// Create a new resolution from the given pinned packages.
19
- pub fn new ( graph : Graph < Node , Edge , Directed > ) -> Self {
21
+ pub fn new ( graph : petgraph :: graph :: DiGraph < Node , Edge > ) -> Self {
20
22
Self {
21
23
graph,
22
24
diagnostics : Vec :: new ( ) ,
23
25
}
24
26
}
25
27
26
28
/// Return the underlying graph of the resolution.
27
- pub fn graph ( & self ) -> & Graph < Node , Edge , Directed > {
29
+ pub fn graph ( & self ) -> & petgraph :: graph :: DiGraph < Node , Edge > {
28
30
& self . graph
29
31
}
30
32
@@ -174,10 +176,8 @@ impl Diagnostic for ResolutionDiagnostic {
174
176
175
177
/// A node in the resolution, along with whether its been filtered out.
176
178
///
177
- /// This is similar to [`ResolutionGraph`], but represents a resolution for a single platform.
178
- ///
179
179
/// We retain filtered nodes as we still need to be able to trace dependencies through the graph
180
- /// (e.g., to determine why a package was install in the resolution).
180
+ /// (e.g., to determine why a package was included in the resolution).
181
181
#[ derive( Debug , Clone ) ]
182
182
pub enum Node {
183
183
Root ,
0 commit comments