chore: align local ruff with CI's dependency window#9732
Merged
Conversation
Local make py-check ran uv run ruff check --fix, which re-resolves ruff and floated to a newer version than CI's pinned lint, rewriting files CI considered clean. Add [tool.uv] exclude-newer = "7 days" so local resolution mirrors CI's UV_EXCLUDE_NEWER, pin the ruff-pre-commit rev to the resulting version (v0.15.14), and commit the autofixes that version produces.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
No issues found across 10 files
Architecture diagram
sequenceDiagram
participant Dev as Developer
participant Local as Local Environment
participant CI as CI Pipeline
participant UV as uv Package Manager
participant Ruff as Ruff Linter
participant PreCommit as pre-commit CI
Note over Dev,PreCommit: Dependency Version Alignment Flow
Dev->>Local: Run `make py-check`
Local->>UV: Execute `uv run ruff check --fix`
UV->>UV: Read pyproject.toml config
alt NEW: [tool.uv] exclude-newer = "7 days"
UV->>UV: Apply 7-day version window to resolution
UV->>Ruff: Resolve ruff version within window
Ruff-->>UV: Return version <= 0.15.14
else Old behavior (no window)
UV->>Ruff: Resolve latest ruff version
Ruff-->>UV: Return version 0.15.15+
end
UV-->>Local: Provide ruff binary
Local->>Ruff: Execute linting and formatting
Ruff-->>Local: Apply autofixes (F811, unused imports)
Note over CI,PreCommit: CI Pipeline Resolution
CI->>CI: Set UV_EXCLUDE_NEWER="7 days"
CI->>UV: Execute `uv run ruff check --fix`
UV->>UV: Apply same 7-day window
UV->>Ruff: Resolve ruff version within window
Ruff-->>UV: Return version 0.15.14
UV-->>CI: Provide ruff binary
CI->>Ruff: Execute linting and formatting
Ruff-->>CI: Clean results (matches local)
Note over PreCommit: Pre-commit Hooks
PreCommit->>PreCommit: Install ruff-pre-commit v0.15.14
PreCommit->>Ruff: Run ruff-check and ruff-format
Ruff-->>PreCommit: Results match windowed resolution
Note over Dev,PreCommit: Result: Local, CI, and pre-commit all use ruff v0.15.14
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns local Python dependency resolution with CI’s 7-day uv dependency window, reducing Ruff version drift between local checks, CI linting, and pre-commit.
Changes:
- Adds
[tool.uv] exclude-newer = "7 days"to mirror CI resolution behavior. - Updates the Ruff pre-commit hook from
v0.15.10tov0.15.14. - Applies Ruff import autofixes by removing duplicate/runtime-only type imports.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Adds the uv dependency age window used by CI. |
.pre-commit-config.yaml |
Updates the Ruff pre-commit hook revision. |
tests/_runtime/test_manage_script_metadata.py |
Removes a runtime-only type import. |
marimo/_utils/narwhals_utils.py |
Removes a type-only Narwhals runtime import. |
marimo/_runtime/complete.py |
Removes a type-only threading runtime import. |
marimo/_plugins/ui/_impl/table.py |
Moves Callable into the existing type-checking imports. |
marimo/_plugins/ui/_impl/dataframes/transforms/handlers.py |
Removes a type-only Callable runtime import. |
marimo/_lint/linter.py |
Removes type-only collection imports from runtime. |
marimo/_ast/app.py |
Removes a duplicate Sequence type import. |
marimo/_ai/_tools/tools/cells.py |
Removes a duplicate CellData type import. |
Light2Dark
approved these changes
May 30, 2026
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.9-dev24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
make py-checkrunsuv run ruff check --fix, which re-resolves ruff rather than using a frozen lock (uv.lockis gitignored). Locally there was no upper bound, so it floated to whatever ruffuvresolved at setup time. CI's lint job (test_checkintest_be.yaml) runs the same command but withUV_EXCLUDE_NEWER: "7 days", so CI resolves the latest ruff aged >= 7 days.Concretely: CI resolved ruff <= 0.15.14 (clean tree), while local floated to 0.15.15, which added a new
F811autofix (runtime imports also re-imported underTYPE_CHECKING) and 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'sUV_EXCLUDE_NEWER. Localuv run/uv locknow resolve the same versions CI would resolve when you set up. Point-in-time: a fresh setup matches CI; a stale checkout matches once re-locked..pre-commit-config.yaml: pinruff-pre-committo 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.TYPE_CHECKING.No version is hard-pinned; the floor stays
ruff>=0.15.9and 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 .-> cleanuvx ruff@0.15.14 check .-> All checks passeduvx pre-commit run ruff-check/ruff-format --all-files-> Passedmake py-check-> lint, format, typecheck (713 files), lock all passtests/_runtime/test_manage_script_metadata.py-> 14 passed