Skip to content

chore: consolidate dev dependencies into PEP 735 groups - #71

Open
ramakrishnap-nv wants to merge 1 commit into
mainfrom
chore/consolidate-dev-dependencies
Open

chore: consolidate dev dependencies into PEP 735 groups#71
ramakrishnap-nv wants to merge 1 commit into
mainfrom
chore/consolidate-dev-dependencies

Conversation

@ramakrishnap-nv

@ramakrishnap-nv ramakrishnap-nv commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Problem

Developer dependencies were declared in two places at once, under the same name:

[project.optional-dependencies]
dev = ["ruff==0.15.9", "pytest>=9.0", "pre-commit==4.3.0"]

[dependency-groups]
dev = ["ipykernel>=7.1.0"]

Two mechanisms, same name, different contents. Extras are also published in package metadata, so developer tooling was advertised as an optional runtime feature of the library.

Change

Install as Contains
--extra genuine optional runtime features — cuda12, cuda13, cuda13-socp
--group dev ruff, pytest, pre-commit
--group notebooks ipykernel
  • Move ruff/pytest/pre-commit into the dev group; drop the dev extra.
  • Set default-groups = []. uv installs the dev group by default, which would make an end-user or launchable uv sync --extra cuda13 pull ruff/pytest/pre-commit.
  • Update README, CONTRIBUTING and the workflows; document the split in CONTRIBUTING.

A regression this surfaced

Disabling default-groups broke the documented install flow, and I caught it before pushing:

uv sync --extra cuda13
uv run python -m ipykernel install ...   # No module named ipykernel

ipykernel had been in the dev group and only worked because uv installs that group by default — the README's kernel step depended on that implicitly. Registering a Jupyter kernel is an end-user task, not a dev one, so ipykernel moved to its own notebooks group, and the two CI syncs followed by uv run python -m ipykernel install (main.yml:80, release-2512.yml:59) now request it. The GPU-pytest and CPU-test syncs correctly stay --group dev only.

Verification

Full group matrix, checked against a real venv:

uv sync                                ipykernel=n ruff=n pytest=n
uv sync --group notebooks              ipykernel=Y ruff=n pytest=n
uv sync --group dev                    ipykernel=n ruff=Y pytest=Y
uv sync --group notebooks --group dev  ipykernel=Y ruff=Y pytest=Y
  • README flow verified end to end: sync, then register the kernel, succeeds.
  • Tests pass on 3.11 and 3.12 through the --group dev path CI uses (60 passed, 3 skipped).
  • uv lock --locked clean; pre-commit run --all-files clean.

Behaviour change worth noting in review: uv sync --extra dev now fails with

error: Extra `dev` is not defined in the project's `optional-dependencies` table

That is deliberate — a loud failure beats silently producing an environment without the tooling. The launchable notebooks are unaffected; they only ever used uv sync --extra {cuda_suffix}.

Merge ordering

Rebased onto main after #67, #69 and #72 merged. The release-2512.yml edit was dropped, since #67 deleted that file. Still conflicts with #68, which adds a notebooks group (papermill, nbconvert, ipykernel) and ci/utils scripts using --extra dev — the two are compatible in intent (#68 group is a superset), but whichever merges second needs a rebase.

🤖 Generated with Claude Code

@ramakrishnap-nv
ramakrishnap-nv requested review from a team as code owners August 4, 2026 19:23
@ramakrishnap-nv
ramakrishnap-nv requested review from rg20 and tmckayus and removed request for a team August 4, 2026 19:23
The repo declared developer dependencies in two places at once:

    [project.optional-dependencies]  dev = [ruff, pytest, pre-commit]
    [dependency-groups]              dev = [ipykernel]

Two mechanisms, same name, different contents. Extras are also published in
package metadata, so developer tooling was advertised as an optional runtime
feature of the library.

- Move ruff/pytest/pre-commit into the `dev` dependency group and drop the
  `dev` extra. Extras now hold only genuine optional runtime features
  (cuda12, cuda13, cuda13-socp).
- Set `default-groups = []`. uv installs the `dev` group by default, which
  would make an end-user or launchable `uv sync --extra cuda13` pull
  ruff/pytest/pre-commit.
- Split ipykernel into its own `notebooks` group. Registering the Jupyter
  kernel is part of the documented end-user workflow, not a dev task. It
  previously sat in `dev` and only worked because uv installs that group by
  default; with default-groups disabled it has to be requested explicitly.
- Update README, CONTRIBUTING and the workflows to `--group dev`, adding
  `--group notebooks` to the two syncs that are followed by
  `uv run python -m ipykernel install`.
- Document the extras-vs-groups split in CONTRIBUTING.

`uv sync --extra dev` now fails with a clear "Extra `dev` is not defined"
rather than silently producing an environment without the tooling.

Verified the full group matrix: bare `uv sync` pulls none of it;
`--group notebooks` gives ipykernel only; `--group dev` gives ruff/pytest
only; both gives everything. Confirmed the README flow (sync, then register
the kernel) works end to end, and that tests pass on 3.11 and 3.12 via the
`--group dev` path CI uses.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
@ramakrishnap-nv
ramakrishnap-nv force-pushed the chore/consolidate-dev-dependencies branch from 5779a90 to 949772d Compare August 5, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant