uv
uv copied to clipboard
Improve message when attempting to remove package from wrong dependency group
uv version: 0.5.9
If you have dependency groups and attempt to remove a package from the wrong group the warning message provided gives an incomplete command.
[project]
name = "myproject"
version = "0.1.0"
description = "Add your description here"
requires-python = ">=3.11"
[dependency-groups]
dev = [
"black",
]
test = [
"pytest",
"pytest-cov",
]
uv remove pytest --group dev
warning: `pytest` is in the `test` group; try calling `uv remove --group test`
error: The dependency `pytest` could not be found in `dev-dependencies` or `dependency-groups.dev`
The command suggested uv remove --group test is incomplete - the suggestion could just include pytest to make it a valid command.
In addition, the error message for the command below seems confusing too - the black dependency was found in dependency-groups after-all.
uv remove black --group test
warning: `black` is in the `dev` group; try calling `uv remove --group dev`
error: The dependency `black` could not be found in `dependency-groups`