Skip to content

Commit

Permalink
Set exact version specifiers when resolving from lockfile (#5193)
Browse files Browse the repository at this point in the history
## Summary

Should resolve #5192.

## Test Plan

@konstin can you confirm this fixes your issue?
  • Loading branch information
ibraheemdev committed Jul 18, 2024
1 parent 7beae77 commit bbd65fc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/uv-resolver/src/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use distribution_types::{
RemoteSource, Resolution, ResolvedDist, SourceDistCompatibility, ToUrlError, UrlString,
VersionId, WheelCompatibility,
};
use pep440_rs::{Version, VersionSpecifiers};
use pep440_rs::{Version, VersionSpecifier};
use pep508_rs::{
ExtraOperator, MarkerEnvironment, MarkerExpression, MarkerTree, VerbatimUrl, VerbatimUrlError,
};
Expand Down Expand Up @@ -2068,7 +2068,12 @@ impl Dependency {
// Reconstruct the `RequirementSource` from the `Source`.
let source = match &self.distribution_id.source {
Source::Registry(_) => RequirementSource::Registry {
specifier: VersionSpecifiers::empty(),
// We don't store the version specifier that was originally used for resolution in
// the lockfile, so this might be too restrictive. However, this is the only version
// we have the metadata for, so if resolution fails we will need to fallback to a
// clean resolve.
specifier: VersionSpecifier::equals_version(self.distribution_id.version.clone())
.into(),
index: None,
},
Source::Git(repository, git) => {
Expand Down

0 comments on commit bbd65fc

Please sign in to comment.