From f6a15b79f77ad16d96d1235090df85256e9cda7d Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 29 Jan 2025 11:18:13 -0500 Subject: [PATCH] Allow `--no-dev --invert` in `uv tree` (#11068) ## Summary Closes https://github.com/astral-sh/uv/issues/11062. --- crates/uv-cli/src/lib.rs | 2 +- crates/uv/tests/it/tree.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index d45c5942d..624d0f768 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -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. diff --git a/crates/uv/tests/it/tree.rs b/crates/uv/tests/it/tree.rs index 7e71fc4e2..8cdb9961b 100644 --- a/crates/uv/tests/it/tree.rs +++ b/crates/uv/tests/it/tree.rs @@ -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());