mirror of https://github.com/astral-sh/uv
fix `--only-group` in `uv pip` interface (#10902)
This was an oversight in the implementation, thankfully it appears to be a simple fix? (My only hesitation is this implementation essentially claims that --only-group is defacto incompatible with --extra and I *think* that's the case but I'm not certain.)
This commit is contained in:
parent
8ce0736f9e
commit
214494149c
|
|
@ -98,16 +98,21 @@ impl<'a, Context: BuildContext> SourceTreeResolver<'a, Context> {
|
|||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// Flatten any transitive extras.
|
||||
let mut requirements =
|
||||
let mut requirements = Vec::new();
|
||||
|
||||
// Flatten any transitive extras and include dependencies
|
||||
// (unless something like --only-group was passed)
|
||||
if self.groups.prod() {
|
||||
requirements.extend(
|
||||
FlatRequiresDist::from_requirements(metadata.requires_dist, &metadata.name)
|
||||
.into_iter()
|
||||
.map(|requirement| Requirement {
|
||||
origin: Some(origin.clone()),
|
||||
marker: requirement.marker.simplify_extras(&extras),
|
||||
..requirement
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
// Apply dependency-groups
|
||||
for (group_name, group) in &metadata.dependency_groups {
|
||||
|
|
|
|||
|
|
@ -14481,11 +14481,9 @@ fn dependency_group() -> Result<()> {
|
|||
# This file was autogenerated by uv via the following command:
|
||||
# uv pip compile --cache-dir [CACHE_DIR] pyproject.toml --only-group bar
|
||||
iniconfig==2.0.0
|
||||
typing-extensions==4.10.0
|
||||
# via project (pyproject.toml)
|
||||
|
||||
----- stderr -----
|
||||
Resolved 2 packages in [TIME]
|
||||
Resolved 1 package in [TIME]
|
||||
"###);
|
||||
|
||||
context = new_context()?;
|
||||
|
|
|
|||
|
|
@ -8425,11 +8425,10 @@ fn dependency_group() -> Result<()> {
|
|||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Resolved 2 packages in [TIME]
|
||||
Prepared 2 packages in [TIME]
|
||||
Installed 2 packages in [TIME]
|
||||
Resolved 1 package in [TIME]
|
||||
Prepared 1 package in [TIME]
|
||||
Installed 1 package in [TIME]
|
||||
+ iniconfig==2.0.0
|
||||
+ typing-extensions==4.10.0
|
||||
"###);
|
||||
|
||||
context = new_context()?;
|
||||
|
|
|
|||
Loading…
Reference in New Issue