Skip to content

chore: align local ruff with CI's dependency window#9730

Closed
kirangadhave wants to merge 1 commit into
mainfrom
kg/pin-ruff-version
Closed

chore: align local ruff with CI's dependency window#9730
kirangadhave wants to merge 1 commit into
mainfrom
kg/pin-ruff-version

Conversation

@kirangadhave
Copy link
Copy Markdown
Member

@kirangadhave kirangadhave commented May 29, 2026

Problem

make py-check runs uv run ruff check --fix, which re-resolves ruff rather than using a frozen lock (uv.lock is gitignored). Locally there was no upper bound, so it floated to whatever ruff uv resolved at setup time (observed 0.15.13 / 0.15.14 / 0.15.15 across environments). CI's lint job (test_check in test_be.yaml) runs the same command but with UV_EXCLUDE_NEWER: "7 days", so CI resolves the latest ruff aged ≥7 days. The newer local ruff ships detections/fixes (TC002/TC003 import moves, unused-import removals) that CI's windowed version lacks, so local checks rewrote files CI considered clean.

Fix

Make local resolution reproduce CI's window at setup time:

  • pyproject.toml: add [tool.uv] exclude-newer = "7 days", mirroring CI's UV_EXCLUDE_NEWER. Local uv run/uv lock now resolve the same ruff (and other deps) CI would resolve when you set up. This is point-in-time: a fresh setup matches CI; a stale checkout matches once re-locked.
  • .pre-commit-config.yaml: pin ruff-pre-commit to the version that window currently resolves (v0.15.14), since pre-commit.ci installs from the tag and isn't governed by the window. Renovate (minimumReleaseAge: 7 days) keeps the tag tracking.
  • Commit the autofixes the windowed ruff produces: unused-import removals and type-only imports relocated into TYPE_CHECKING.

No version is hard-pinned; the floor stays ruff>=0.15.9 and the window controls the upper bound.

Verification

  • uv run ruff --version -> 0.15.14 (== pre-commit rev == CI's windowed resolution)
  • uv run ruff check . && uv run ruff format --check . -> clean
  • uvx ruff@0.15.14 check . -> All checks passed
  • uvx pre-commit run ruff-check/ruff-format --all-files -> Passed
  • make py-check -> lint, format, typecheck (713 files), lock all pass
  • All modified modules import cleanly; tests/_runtime/test_manage_script_metadata.py -> 14 passed

Align local lint with CI by pinning ruff everywhere (.pre-commit-config.yaml rev, pyproject.toml dev floor) and committing the resulting import-relocation and unused-import autofixes.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment May 29, 2026 7:21pm

Request Review

@kirangadhave
Copy link
Copy Markdown
Member Author

didn't realize the ruff version was released recently.

@kirangadhave kirangadhave changed the title chore: pin ruff to 0.15.15 and apply autofixes chore: align local ruff with CI's dependency window May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant