Allow --no-dev --invert in uv tree (#11068)

## Summary

Closes https://github.com/astral-sh/uv/issues/11062.
This commit is contained in:
Charlie Marsh 2025-01-29 11:18:13 -05:00 committed by GitHub
parent 48976e12e8
commit f6a15b79f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -3385,7 +3385,7 @@ pub struct TreeArgs {
/// Omit the development dependency group.
///
/// This option is an alias for `--no-group dev`.
#[arg(long, overrides_with("dev"), conflicts_with = "invert")]
#[arg(long, overrides_with("dev"))]
pub no_dev: bool,
/// Include dependencies from the specified dependency group.

View file

@ -578,6 +578,7 @@ fn dev_dependencies_inverted() -> Result<()> {
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["iniconfig"]
[tool.uv]
dev-dependencies = ["anyio"]
"#,
@ -601,6 +602,18 @@ fn dev_dependencies_inverted() -> Result<()> {
"###
);
uv_snapshot!(context.filters(), context.tree().arg("--universal").arg("--invert").arg("--no-dev"), @r###"
success: true
exit_code: 0
----- stdout -----
iniconfig v2.0.0
project v0.1.0
----- stderr -----
Resolved 5 packages in [TIME]
"###
);
// `uv tree` should update the lockfile
let lock = context.read("uv.lock");
assert!(!lock.is_empty());