mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Avoid dropping pip sync
requirements with markers (#4051)
## Summary Thankfully this is pretty rare since `pip sync` is usually run on `pip compile` output, and `pip compile` never outputs markers. Closes https://github.com/astral-sh/uv/issues/4044
This commit is contained in:
parent
b0d1fc85a9
commit
ae9610104a
2 changed files with 39 additions and 0 deletions
|
@ -954,6 +954,20 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
|||
} => {
|
||||
// If we're excluding transitive dependencies, short-circuit.
|
||||
if self.dependency_mode.is_direct() {
|
||||
// If a package has a marker, add a dependency from it to the
|
||||
// same package without markers.
|
||||
if marker.is_some() {
|
||||
return Ok(Dependencies::Available(vec![(
|
||||
PubGrubPackage::from(PubGrubPackageInner::Package {
|
||||
name: name.clone(),
|
||||
extra: extra.clone(),
|
||||
marker: None,
|
||||
url: url.clone(),
|
||||
}),
|
||||
Range::singleton(version.clone()),
|
||||
)]));
|
||||
}
|
||||
|
||||
// If an extra is provided, wait for the metadata to be available, since it's
|
||||
// still required for generating the lock file.
|
||||
let dist = match url {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue