Skip to content

universal-lock: track version numbers for all distributions #3356

@BurntSushi

Description

@BurntSushi

When creating a Lock, we currently have a todo!() when trying to extract version numbers:

let version = match resolved_dist.version_or_url() {
VersionOrUrl::Version(v) => v.clone(),
// TODO: We need a way to thread the version number for these
// cases down into this routine. The version number isn't yet in a
// `ResolutionGraph`, so this will require a bit of refactoring.
VersionOrUrl::Url(_) => todo!(),
};

For example, when the distribution comes from a direct URL, it only has a URL and not a version number:

impl DistributionMetadata for DirectUrlBuiltDist {
fn version_or_url(&self) -> VersionOrUrl {
VersionOrUrl::Url(&self.url)
}
}

My understanding is that a version number exists for these distributions in their metadata, but we currently don't keep it around (I believe). We need the version number for our universal lock file, as part of #3347.

Metadata

Metadata

Assignees

Labels

previewExperimental behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions