Allow --no-dev --invert in uv tree (#11068)
## Summary Closes https://github.com/astral-sh/uv/issues/11062.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user