Skip to content

Commit

Permalink
Add
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jan 15, 2025
1 parent f9331ff commit ca3a798
Show file tree
Hide file tree
Showing 33 changed files with 396 additions and 318 deletions.
2 changes: 2 additions & 0 deletions crates/uv-distribution-types/src/dependency_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl DependencyMetadata {
requires_dist: metadata.requires_dist.clone(),
requires_python: metadata.requires_python.clone(),
provides_extras: metadata.provides_extras.clone(),
is_dynamic: false,
})
} else {
// If no version was requested (i.e., it's a direct URL dependency), allow a single
Expand All @@ -70,6 +71,7 @@ impl DependencyMetadata {
requires_dist: metadata.requires_dist.clone(),
requires_python: metadata.requires_python.clone(),
provides_extras: metadata.provides_extras.clone(),
is_dynamic: false,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-distribution-types/src/resolved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl ResolvedDist {
/// Returns the version of the distribution, if available.
pub fn version(&self) -> Option<&Version> {
match self {
Self::Installable { .. } => None,
Self::Installable { version, dist } => dist.version().or(version.as_ref()),
Self::Installed { dist } => Some(dist.version()),
}
}
Expand Down
3 changes: 3 additions & 0 deletions crates/uv-distribution/src/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub struct Metadata {
pub requires_python: Option<VersionSpecifiers>,
pub provides_extras: Vec<ExtraName>,
pub dependency_groups: BTreeMap<GroupName, Vec<uv_pypi_types::Requirement>>,
pub is_dynamic: bool,
}

impl Metadata {
Expand All @@ -67,6 +68,7 @@ impl Metadata {
requires_python: metadata.requires_python,
provides_extras: metadata.provides_extras,
dependency_groups: BTreeMap::default(),
is_dynamic: metadata.is_dynamic,
}
}

Expand Down Expand Up @@ -109,6 +111,7 @@ impl Metadata {
requires_python: metadata.requires_python,
provides_extras,
dependency_groups,
is_dynamic: metadata.is_dynamic,
})
}
}
Expand Down
Loading

0 comments on commit ca3a798

Please sign in to comment.