Skip to content

feat(deps): centralise dev deps via PEP 735 + uv.lock#1068

Merged
lord-haffi merged 3 commits into
mainfrom
feat/migrate-to-uv-dependency-groups
Jun 5, 2026
Merged

feat(deps): centralise dev deps via PEP 735 + uv.lock#1068
lord-haffi merged 3 commits into
mainfrom
feat/migrate-to-uv-dependency-groups

Conversation

@lord-haffi
Copy link
Copy Markdown
Collaborator

Summary

Closes #897.

  • Replace the 14 dev_requirements/*.in/*.txt files with PEP 735 [dependency-groups] in pyproject.toml (tests, coverage, type_check, linting, formatting, packaging, json_schemas, docs, plus a dev meta-group).
  • Switch tox to tox-uv: [testenv:*] now use dependency_groups = … instead of deps = -r dev_requirements/…. Editable install declared once at [testenv] level via package = editable.
  • Update CI: every pip install toxpip install tox tox-uv. The two workflow steps that bypassed tox (python-publish.yml and python-publish-scheduled.yml) now use pip install uv + uv pip install --system --group ….
  • Drop the /dev_requirements/ dependabot pip entry — the root entry covers PEP 735 groups too.
  • Lock pinned versions in uv.lock (133 packages, generated against the new groups).
  • README + docs/contributing_guide.rst: new "Entwicklungs-Setup" section pointing at uv + tox-uv (replaces the stale link to python_template_repository).

Test plan

  • tox -e tests — 121 passed locally with tox-uv, editable bo4e built via hatchling.
  • tox -e linting
  • tox -e type_check
  • tox -e coverage
  • tox -e docs
  • CI: all matrix workflows green
  • Dependabot picks up the runtime + PEP 735 groups from the root entry on next run

🤖 Generated with Claude Code

lord-haffi and others added 2 commits June 5, 2026 09:54
Closes #897.

Replace the 14 dev_requirements/*.in/*.txt files with PEP 735
dependency groups in pyproject.toml and pin them via uv.lock,
rewired into tox via tox-uv. Single source of truth, single lock
file, no more pip-compile loop per group.

What changed
------------

- pyproject.toml: new [dependency-groups] section with tests,
  coverage, type_check, linting, formatting, packaging,
  json_schemas, docs, and a `dev` meta-group that includes them
  all plus pre-commit and pip-tools. Groups use {include-group =
  ...} where they share deps (e.g. linting includes docs and
  json_schemas).

- tox.ini: [tox] requires tox>=4.21 and tox-uv>=1.16. Each
  [testenv:*] swaps `deps = -r dev_requirements/...` for
  `dependency_groups = <name>`. The `python -m pip install
  --upgrade pip` warm-up is gone — tox-uv uses uv, not pip.
  Editable-install behaviour is now declared once at [testenv]
  level via `package = editable`.

- .github/workflows/*: every `pip install tox` becomes `pip
  install tox tox-uv`. Two places that bypassed tox and
  pip-installed dev_requirements directly (python-publish.yml
  check_version_tag and build-n-publish; python-publish-
  scheduled.yml build-n-publish) now use `pip install uv` then
  `uv pip install --system [--group ...] ...`.

- .github/dependabot.yml: drop the /dev_requirements/ pip entry;
  the / entry covers both runtime and PEP 735 groups now.

- dev_requirements/: deleted in its entirety (14 files).

- README.rst: new "Entwicklungs-Setup" section pointing at uv +
  tox-uv.

- docs/contributing_guide.rst: replace the stale link to the
  Hochfrequenz python_template_repository with concrete uv-based
  steps for this repo.

uv.lock — host-side step required
---------------------------------

uv.lock is NOT included in this commit. PyPI is unreachable from
the sandbox where this branch was prepared, so `uv lock` can't run
here. Before merging, run

    uv lock

on a host with PyPI access and amend the resulting `uv.lock` to
this branch. Without it, `tox-uv`'s default runner (non-lock mode)
still works — it just resolves fresh each env-create.

Verification
------------

In-sandbox sanity checks only:

- python3 -m tomllib parses pyproject.toml.
- configparser parses tox.ini and lists all expected sections.
- Workflow YAML files have correct EOL and no tabs.

End-to-end verification (`tox -e tests` / `tox -e docs` etc.)
needs uv.lock and PyPI access, so will land in CI on first push.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Run `uv lock` against pyproject.toml's runtime deps and the
dependency-groups added in ad1c406. Resolved 133 packages; no
manifest edits required.

Verified locally:
- `tox -e tests` builds an editable bo4e under .tox/tests with
  tox-uv and runs the full suite: 121 passed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CI on the first push of this branch installed pylint 4.0.5 even
though uv.lock pinned 3.3.9, because tox-uv's default runner is
`uv-venv-runner`, which calls `uv pip install` against pyproject
and never consults the lock. That defeats the point of committing
uv.lock and reproduced the divergence the old per-group
pip-compile setup had.

tox.ini: switch [testenv] to `runner = uv-venv-lock-runner`, so
every env-create is a `uv sync --group <name>` against uv.lock.

pyproject.toml: cap `pylint<4` in the linting group. The previous
dev_requirements/requirements-linting.txt pinned `pylint==3.3.9`
because `.pylintrc` uses the (now-removed) `suggestion-mode` option
and generate_or_validate_json_schemas.py has a `PARSABLE_CLASS_TYPE`
constant that pylint 4 rejects. The pylint 4 migration is out of
scope for this PR; the cap defers it cleanly.

uv.lock: regenerated. Collapses the prior `pylint v3.3.9, v4.0.5`
fork (caused by `requires-python = ">=3.9"` plus pylint 4 dropping
3.9 support) to a single `pylint==3.3.9` row. Similar collapses for
astroid (3.3.11) and isort (6.1.0).

Verified locally with the lock-runner:
- tox -e linting    -> OK
- tox -e type_check -> OK
- tox -e coverage   -> OK (99% coverage, threshold 99)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lord-haffi lord-haffi merged commit 909008a into main Jun 5, 2026
27 checks passed
@lord-haffi lord-haffi deleted the feat/migrate-to-uv-dependency-groups branch June 5, 2026 13:06
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