Skip to content

Unideal error message on recursive dependency groups (depending on command) #15397

@henryiii

Description

@henryiii

Not sure if this is exactly a bug, per se, just an error message that's not really helpful.

I noticed that uv pip install --system -e.[schema] --group test produced an unhelpful error:

error: Failed to read dependency groups from: /home/runner/work/uhi/uhi/pyproject.toml
Project `uhi` has malformed dependency groups

But when I tried uv run pytest locally, I got a far more helpful error:

error: Project `uhi` has malformed dependency groups
  Caused by: Detected a cycle in `dependency-groups`: `dev` -> `test` -> `dev`

That was my mistake, I copy-pasted and forgot to change "test" into "test-core", so test depended on itself. (I think the message should have been `dev` -> `test` -> `test`, but at least it was better)

My pyproject.toml has this in dependency-groups:

test = [
  { include-group = "test" },
  "h5py; platform_python_implementation == 'CPython'",  # Doesn't support free-threaded Python currently
]
dev = [{ include-group = "test" }]

Metadata

Metadata

Assignees

Labels

error messagesMessaging when something goes wrong

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions