-
-
Notifications
You must be signed in to change notification settings - Fork 168
Description
"One uv.lock to rule them all"!
Summary
Add support for managing the Python tool dependencies used by hooks in .pre-commit-config.yaml via a dedicated dependency group in pyproject.toml, and ensure those dependencies are synced into the root uv.lock.
Motivation
In many repos, hooks reference Python tools (for example: ruff, rumdl, mypy, pytest, etc.). Today, those tool versions typically live outside the project dependency management flow, which can lead to:
- Duplicate version pinning across files.
- Drift between what CI installs and what developers have locally.
- A less reproducible setup when using
uvwith a lock file.
Centralizing these tool versions in pyproject.toml would make hook tooling easier to maintain and more consistent.
Proposed behavior
1. Declare hook tool dependencies in pyproject.toml
Allow users to define a dependency group named prek under [dependency-groups] (PEP 735 style), for example:
[dependency-groups]
prek = [
"ruff>=0.11.13",
"rumdl>=0.0.210",
]Which can be added using uv add --group prek ruff.
2. Sync those dependencies into the root uv.lock
When the repo uses uv and has a root uv.lock, ensure the dependency-groups.prek dependencies are included and locked there, so the hook tooling environment is reproducible.
Expected outcome
- A single source of truth for Python hook tooling versions.
- Less duplication between
.pre-commit-config.yamland Python dependency management. - A reproducible, locked set of hook tool dependencies via
uv.lock.
Notes / scope
- This request is specifically about Python hook tooling dependencies (not non-Python tools).