Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify interaction of --group and default dev dependencies #11691

Open
rsyring opened this issue Feb 21, 2025 · 1 comment
Open

Clarify interaction of --group and default dev dependencies #11691

rsyring opened this issue Feb 21, 2025 · 1 comment
Labels
question Asking for clarification or support

Comments

@rsyring
Copy link

rsyring commented Feb 21, 2025

Question

Considering dependency groups like:

[dependency-groups]
dev = [
    {include-group = "tests"},
    'hatch>=1.14.0',
    'pip-audit',
    'ruff>=0.9.6',
]
tests = [
    'nox>=2025.2.9',
    'pytest>=8.3.4',
]

When prepping for test runs in nox, I'd expect to be able to do:

uv sync --group tests

But with that invocation, the dev dependency group is also included. My next attempt was:

uv sync --only-group tests

But that doesn't include the project's dependencies either, which doesn't work for testing. So my final attempt is:

uv sync --no-dev --group tests

Which works but seems clunky. IMO, it would be more intuitive if:

# install project + group tests
uv sync --group tests

# install project + group tests and group dev
uv sync --group dev --group tests

And if I always want dev installed when tests is installed then I use include-group to make that happen instead of relying on implicit dev install.

IMO, uv isn't currently using the dev group as a default. A default implies it's the selection unless something else is chosen. I think if uv adjusted it to be a true default, the ux might be better.

Also, FWIW, that there are seven different CLI options for dealing with dependency groups. Does that seem like a lot to anyone else?

As always, YMMV. :)

Thanks.

Platform

Ubuntu 24.04 x64

Version

0.6.2

@rsyring rsyring added the question Asking for clarification or support label Feb 21, 2025
@T-256
Copy link
Contributor

T-256 commented Feb 21, 2025

IIUC, You mean using --group should disable tool.uv.default-groups functionality. I'm favor of that then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

2 participants