uv: uv --no-dev --group dev does not install dev group

Summary

Reproducible:

https://github.com/koxudaxi/datamodel-code-generator/actions/runs/13119193488/job/36600851153 https://github.com/koxudaxi/datamodel-code-generator/blob/main/pyproject.toml#L59-L77

does not install pytest:

dev: uv-sync> uv sync --frozen --python-preference system --no-dev --group dev -p \
/home/runner/.local/share/uv/tools/tox/bin/python

Platform

any

Version

0.5.26

Python version

any

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Now that I’ve properly overhauled this subsystem (in #11224), I can give some more concrete insight on how this is extra fun/weird.

We actually special-case --no-dev and --dev to positionally override eachother, so --no-dev --dev enables dev while --dev --no-dev disables it. This is almost certainly legacy behaviour from when these were the only flags. Meanwhile --group dev does not participate in this overriding (and I don’t think it should, if anything I’d want to drop the special case for --dev, but that’s a breaking change).

In the new impl we could definitely warn if you enable something only to disable it, but I’m not confident that this won’t be yelling at people for doing something we explicitly support. At a minimum I’m going to open a PR to improve the docs a bit.

Yes.

Good news for you: --no-default-groups already exists, it’s just not surfaced as well in the high-level config docs as --no-dev is. It only shows up in the generated full CLI docs (e.g. here).

No, --no-dev has always applied equally to the non-PEP 735 group and a PEP 735 group named “dev”.