Skip to content

build: adopt PEP 735 dependency groups for dev/test/doc#75

Merged
Marius1311 merged 1 commit intomainfrom
refactor/pep735-dependency-groups
Apr 24, 2026
Merged

build: adopt PEP 735 dependency groups for dev/test/doc#75
Marius1311 merged 1 commit intomainfrom
refactor/pep735-dependency-groups

Conversation

@Marius1311
Copy link
Copy Markdown
Member

Aligns cell-annotator with cookiecutter-scverse v0.7.0 by moving development-only dependencies from [project.optional-dependencies] to [dependency-groups] (PEP 735). Provider layers stay as optional-dependencies since end users install them via pip install cell-annotator[openai] etc.

New layout

[dependency-groups] (dev-only — not shipped in the wheel metadata):

  • dev = pre-commit, twine
  • test = pytest, coverage, flaky, pytest-cov
  • doc = Sphinx stack

[project.optional-dependencies] (install-time extras, unchanged for end users):

  • provider layers: openai, anthropic, gemini, all-providers, colors, gpu, tutorials
  • test — thinned to a pointer at cell-annotator[all-providers] + cell-annotator[colors]. The Python test packages no longer live here, so there's a single source of truth per audience.

[tool.hatch.envs.*] — switched features = [...] to dependency-groups = [...] for the default, docs, and hatch-test envs. hatch-test also keeps features = [ "test" ] so the provider extras flow in via the thin pointer above.

Docs

  • docs/contributing.md — pip recipe updated to pip install --group dev --group test --group doc -e ".[test]" (requires pip 25.1+).
  • docs/contributing.md — uv recipe updated to uv sync --all-extras --all-groups.

Validation

  • uv sync --all-extras --all-groups resolves cleanly.
  • uv run --group test --extra test pytest188 passed.
  • hatch env show -i renders the hatch-test matrix with the expected dependencies.
  • sphinx-build -M html docs docs/_build succeeds with no warnings.

Notes

  • End users are unaffected: pip install cell-annotator[openai] still works exactly as before.
  • External CI that installs cell-annotator[test] will continue to get the provider extras, but will now need to also pull --group test (or switch to uv / hatch) to get the Python test packages. We have no external consumer of [test] that I'm aware of.

Part of #73. Stacks on #74.

Aligns cell-annotator with cookiecutter-scverse v0.7.0 by moving
development-only dependencies from `[project.optional-dependencies]`
to `[dependency-groups]` (PEP 735). Provider layers stay as
`optional-dependencies` since end users install them via `pip install
cell-annotator[openai]` etc.

Layout:

- `[dependency-groups]`:
  - `dev` = pre-commit, twine
  - `test` = Python test packages (pytest, coverage, flaky, pytest-cov)
  - `doc` = Sphinx stack
- `[project.optional-dependencies]`:
  - provider layers (openai, anthropic, gemini, all-providers, colors,
    gpu, tutorials) — unchanged
  - `test` thinned to a pointer at `cell-annotator[all-providers]` +
    `cell-annotator[colors]`, so `pip install cell-annotator[test]`
    still pulls the provider extras the suite exercises. Python test
    packages are no longer duplicated here.
- `[tool.hatch.envs.*]`:
  - switched `features = [...]` to `dependency-groups = [...]` for the
    default, docs, and hatch-test envs.
  - hatch-test also keeps `features = [ "test" ]` so the provider
    extras flow in via the thin pointer above.

Docs:

- `docs/contributing.md` — pip recipe updated to use
  `pip install --group dev --group test --group doc -e ".[test]"`
  (pip 25.1+). uv recipe updated to `uv sync --all-extras --all-groups`.

Validation:

- `uv sync --all-extras --all-groups` resolves cleanly.
- `uv run --group test --extra test pytest` → 188 passed.
- `hatch env show -i` lists the hatch-test matrix correctly.
- `sphinx-build -M html docs docs/_build` succeeds with no warnings.

Part of #73.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.95%. Comparing base (daf4b1c) to head (ecb4382).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #75   +/-   ##
=======================================
  Coverage   79.95%   79.95%           
=======================================
  Files          15       15           
  Lines        1237     1237           
=======================================
  Hits          989      989           
  Misses        248      248           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Marius1311 Marius1311 merged commit 215b806 into main Apr 24, 2026
9 checks passed
@Marius1311 Marius1311 deleted the refactor/pep735-dependency-groups branch April 24, 2026 20:47
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