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

Rename sourcedist to sdist in lockfile #3590

Merged
merged 1 commit into from
May 14, 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
16 changes: 8 additions & 8 deletions crates/uv-resolver/src/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl TryFrom<LockWire> for Lock {
// Also check that our sources are consistent with whether we have
// hashes or not.
let requires_hash = dist.id.source.kind.requires_hash();
if let Some(ref sdist) = dist.sourcedist {
if let Some(ref sdist) = dist.sdist {
if requires_hash != sdist.hash.is_some() {
return Err(LockError::hash(
dist.id.clone(),
Expand Down Expand Up @@ -194,7 +194,7 @@ pub(crate) struct Distribution {
#[serde(default)]
pub(crate) marker: Option<String>,
#[serde(default)]
pub(crate) sourcedist: Option<SourceDist>,
pub(crate) sdist: Option<SourceDist>,
#[serde(default, rename = "wheel", skip_serializing_if = "Vec::is_empty")]
pub(crate) wheels: Vec<Wheel>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
Expand All @@ -206,19 +206,19 @@ impl Distribution {
resolved_dist: &ResolvedDist,
) -> Result<Distribution, LockError> {
let id = DistributionId::from_resolved_dist(resolved_dist);
let mut sourcedist = None;
let mut sdist = None;
let mut wheels = vec![];
if let Some(wheel) = Wheel::from_resolved_dist(resolved_dist)? {
wheels.push(wheel);
} else if let Some(sdist) = SourceDist::from_resolved_dist(resolved_dist)? {
sourcedist = Some(sdist);
if let Some(dist) = Wheel::from_resolved_dist(resolved_dist)? {
wheels.push(dist);
} else if let Some(dist) = SourceDist::from_resolved_dist(resolved_dist)? {
sdist = Some(dist);
}
Ok(Distribution {
id,
// TODO: Refactoring is needed to get the marker expressions for a
// particular resolved dist to this point.
marker: None,
sourcedist,
sdist,
wheels,
dependencies: vec![],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Ok(
},
},
marker: None,
sourcedist: None,
sdist: None,
wheels: [
Wheel {
url: Url {
Expand Down
Loading