Skip to content

Use lower-direct resolution and create groups to factorize dep lower bounds#708

Closed
ValerianRey wants to merge 1 commit into
mainfrom
improve-dep-groups
Closed

Use lower-direct resolution and create groups to factorize dep lower bounds#708
ValerianRey wants to merge 1 commit into
mainfrom
improve-dep-groups

Conversation

@ValerianRey

Copy link
Copy Markdown
Member

No description provided.

@ValerianRey ValerianRey added the cc: ci Conventional commit type for changes to the CI (Github workflows and actions). label May 27, 2026
@ValerianRey

Copy link
Copy Markdown
Member Author

/opencode:Plan please explain what went wrong (why the CI doesn't pass). Can we salvage this or is it a dead end?

@opencode-agent

Copy link
Copy Markdown
Contributor

The CI is failing because pyproject.toml contains invalid syntax in [project.optional-dependencies].

What went wrong

The PR places {include-group = "_xxx"} entries inside [project.optional-dependencies]:

[project.optional-dependencies]
quadprog_projector = [
    {include-group = "_numpy"},
    {include-group = "_quadprog"},
    ...
]

This is not allowed. The include-group syntax is defined in PEP 735 and is only valid inside [dependency-groups]. [project.optional-dependencies] (defined by PEP 621) must contain standard PEP 508 dependency specifier strings like "numpy>=1.21.2".

When uv pip install -e '.[full]' runs, uv parses pyproject.toml to resolve the full extra. Because full transitively references quadprog_projector, nash_mtl, cagrad, and fairgrad — all of which contain invalid {include-group = ...} entries — uv fails with a pyproject.toml parsing/validation error before it even starts installing packages.

Every job that installs an extra (which is most of them: tests, build-doc, code-quality) hits this error.

Can we salvage this?

Yes, but not in its current form. You have two practical paths:

Option 1: Partial salvage (minimal change)
Keep the [dependency-groups] table with the underscore-prefixed groups and the nested include-group references — that part is valid and works. But expand [project.optional-dependencies] back to explicit dependency strings. For example:

[project.optional-dependencies]
quadprog_projector = [
    "numpy>=1.21.2",
    "quadprog>=0.1.9, != 0.1.10",
    "qpsolvers>=1.0.1",
]

You lose the cross-table factorization, but the CI works again with uv pip install -e '.[full]'.

Option 2: Full refactor to uv sync
Stop using uv pip install -e '.[...]' entirely and switch the workflow to uv sync --extra full --group test (etc.). uv sync natively handles both extras and dependency groups together. However, this requires committing a uv.lock file and restructuring the CI around uv's project interface rather than its pip-compatible interface. That's a bigger change than this PR currently makes.

Recommendation

Go with Option 1 for this PR. It preserves the useful dependency-group factorization for CI while keeping the project's published extras standards-compliant. Option 2 is a valid future direction but is a separate architectural decision.

New%20session%20-%202026-05-27T18%3A27%3A29.849Z
opencode session  |  github run

@ValerianRey

Copy link
Copy Markdown
Member Author

@PierreQuinton apparently it's not possible to refer to dependency groups in optional dependencies. So we can't really improve on that matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: ci Conventional commit type for changes to the CI (Github workflows and actions).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant