Skip to content

ci: run ruff from uv.lock in CI and pre-commit - #183

Merged
MarTrepodi merged 2 commits into
developfrom
ci/ruff-single-source
Oct 13, 2026
Merged

MarTrepodi merged 2 commits into
developfrom
ci/ruff-single-source

Conversation

@MarTrepodi

Copy link
Copy Markdown
Collaborator

Summary

Ruff currently runs at three different versions:

Where Before Source
CI lint job latest on PyPI (0.17.x) unpinned uvx ruff
uv.lock / uv run 0.15.15 Dependabot (uv)
pre-commit 0.15.4 ruff-pre-commit rev, not tracked by Dependabot

This PR makes uv.lock the single source of truth, so a Dependabot uv bump (e.g. #180) moves all three together.

Changes

  • pyproject.toml: new lint dependency group (ruff>=0.8), which dev includes, matching the existing typecheck group. uv.lock changes only in group metadata; ruff stays at 0.15.15.
  • ci.yml: the lint job runs uv sync --locked --only-group lint, then uv run --no-sync ruff check/format. --only-group installs only ruff (not the project or its test/doc deps). --locked fails if the lock is stale.
  • .pre-commit-config.yaml: ruff-pre-commit is replaced with repo: local hooks (language: system, entry: uv run ruff ...), mirroring the existing local ty hook. Kept exclude: ^examples/ on the check hook, plus --force-exclude and require_serial from the upstream hook definitions. Only the ruff section changed, so this should merge cleanly with ci(ci): pin commitlint once and run the same hook in CI #181 (which touches the commitlint hook only).
  • CONTRIBUTING.md, PR template: uvx ruff → uv run ruff.

Verification

  • CI steps, run locally in a fresh environment: uv sync --locked --only-group lint installs only ruff==0.15.15. ruff check src/ tests/ passes, and ruff format --check src/ tests/ reports all 62 files already formatted.
  • The new pre-commit ruff and ruff-format hooks pass on all files under src/ and tests/.
  • uvx pre-commit run --all-files does not pass, but this is pre-existing. The old config (ruff-pre-commit v0.15.4) gives exactly the same results on develop: 2 B905 errors in parity/scripts/, 20 files reformatted under examples/ and parity/, and end-of-file fixes in two tests/resources/*.json fixtures. This PR doesn't fix them, to keep it focused.

Note on the version jump

Until now, CI has been linting with ruff 0.17.x. After this PR it uses 0.15.15 until #180 lands. Once #180 merges, all three run 0.17.0.

🤖 Generated with Claude Code

CI used unpinned `uvx ruff` (latest on PyPI), pre-commit pinned
ruff-pre-commit at v0.15.4 (not tracked by Dependabot), and uv.lock
held 0.15.15. Make uv.lock the single source of truth so Dependabot
uv bumps move all three together.

- Add a `lint` dependency group with ruff; `dev` includes it.
- CI lint job: `uv sync --locked --only-group lint`, then
  `uv run --no-sync ruff ...`.
- pre-commit: replace ruff-pre-commit with local `uv run ruff` hooks,
  matching the existing local ty hook.
- Update CONTRIBUTING.md and the PR template to `uv run ruff`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci Changes related to continuous integration processes dependencies Updates to package dependency libraries labels Oct 13, 2026
@MarTrepodi
MarTrepodi enabled auto-merge October 13, 2026 13:43
@MarTrepodi
MarTrepodi merged commit d31b3d2 into develop Oct 13, 2026
17 checks passed
@MarTrepodi
MarTrepodi deleted the ci/ruff-single-source branch October 13, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Changes related to continuous integration processes dependencies Updates to package dependency libraries documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant