mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-01 14:31:12 +00:00
Set exact version specifiers when resolving from lockfile (#5193)
## Summary Should resolve https://github.com/astral-sh/uv/issues/5192. ## Test Plan @konstin can you confirm this fixes your issue?
This commit is contained in:
parent
7beae77283
commit
bbd65fc626
1 changed files with 7 additions and 2 deletions
|
@ -24,7 +24,7 @@ use distribution_types::{
|
||||||
RemoteSource, Resolution, ResolvedDist, SourceDistCompatibility, ToUrlError, UrlString,
|
RemoteSource, Resolution, ResolvedDist, SourceDistCompatibility, ToUrlError, UrlString,
|
||||||
VersionId, WheelCompatibility,
|
VersionId, WheelCompatibility,
|
||||||
};
|
};
|
||||||
use pep440_rs::{Version, VersionSpecifiers};
|
use pep440_rs::{Version, VersionSpecifier};
|
||||||
use pep508_rs::{
|
use pep508_rs::{
|
||||||
ExtraOperator, MarkerEnvironment, MarkerExpression, MarkerTree, VerbatimUrl, VerbatimUrlError,
|
ExtraOperator, MarkerEnvironment, MarkerExpression, MarkerTree, VerbatimUrl, VerbatimUrlError,
|
||||||
};
|
};
|
||||||
|
@ -2068,7 +2068,12 @@ impl Dependency {
|
||||||
// Reconstruct the `RequirementSource` from the `Source`.
|
// Reconstruct the `RequirementSource` from the `Source`.
|
||||||
let source = match &self.distribution_id.source {
|
let source = match &self.distribution_id.source {
|
||||||
Source::Registry(_) => RequirementSource::Registry {
|
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,
|
index: None,
|
||||||
},
|
},
|
||||||
Source::Git(repository, git) => {
|
Source::Git(repository, git) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue