Run ruff from the locked virtualenv in make targets - #167
Conversation
CI installed ruff with `uv tool install ruff`, which floats to the latest release, while the project lockfile pins ruff 0.14.7. With `preview = true` in pyproject, every new preview rule shipped upstream (most recently RUF076 in 0.15.x) broke the lint gate on every open PR without any change in the repository. Invoke ruff through `uv run` in the fmt, check-fmt, and lint targets so both CI and local runs resolve the locked version, move the ruff probe from the PATH tool list to the virtualenv tool list, and drop the floating ruff install from the CI workflow.
|
Warning Review limit reached
More reviews will be available in 39 minutes and 23 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughConsolidate linter/tool handling: move ChangesTool management and uv invocation consolidation
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 19 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (19 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRoutes ruff invocations through the locked virtualenv and pins pylint’s version to avoid CI lint instability, while simplifying CI tool installation accordingly. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The pylint-pypy-shim git ref is pinned, but pylint itself was a floating dependency of it, so new pylint releases changed lint behaviour without any repository change — the same skew class as the ruff issue this branch fixes (pylint 4.0.5 started flagging bound str.format references as consider-using-f-string overnight). Pass `--with 'pylint==$(PYLINT_VERSION)'` to `uv tool run` so the lint gate resolves a known pylint; bumping PYLINT_VERSION is now an explicit, reviewable change.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Now that ruff is always invoked via
$(UV_RUN_ENV) uv run ruff, consider extracting this into aRUFFmake variable to avoid repeating the same command infmt,check-fmt, andlintand make future changes easier. - You’ve addressed version skew for ruff and pylint; if mbake and ty are equally sensitive, you may want to pin their versions in the CI
uv tool installloop so their behavior doesn’t change under you without a corresponding repo change.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that ruff is always invoked via `$(UV_RUN_ENV) uv run ruff`, consider extracting this into a `RUFF` make variable to avoid repeating the same command in `fmt`, `check-fmt`, and `lint` and make future changes easier.
- You’ve addressed version skew for ruff and pylint; if mbake and ty are equally sensitive, you may want to pin their versions in the CI `uv tool install` loop so their behavior doesn’t change under you without a corresponding repo change.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
Extract the locked `ruff` invocation into a Makefile variable so the `fmt`, `check-fmt`, and `lint` targets share one command definition. Pin CI tool installs for `mbake` and `ty` to avoid unreviewed drift.
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
Record that Ruff runs through `$(RUFF)` and `VENV_TOOLS` so maintainers keep lint and formatting on the locked `uv run` path.
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
Add `PYLINT_VERSION` to the developer guide lint variable table and describe how `$(PYLINT)` pins Pylint with the `uv tool run --with` option.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/developers-guide.md`:
- Around line 502-507: The docs snippet for the make lint sequence omits the
environment wrapper used in the real Makefile; update the second step to show
the mirrored, locked environment by changing "uv run interrogate --fail-under
100 cuprum" to include the UV wrapper so it reads "$(UV_RUN_ENV) uv run
interrogate --fail-under 100 cuprum", keeping the surrounding steps (e.g.,
"$(RUFF) check" and "$(PYLINT) $(PYLINT_TARGETS)") unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 04a5b661-0c8d-47eb-a3cf-4c24bd43878b
📒 Files selected for processing (1)
docs/developers-guide.md
Mirror the Makefile command by showing `$(UV_RUN_ENV) uv run interrogate` in the developer guide lint sequence.
Summary
Fixes the systemic
lint-testfailure that was breaking every open PR (andmainitself), and pins the second tool with the same exposure.ruff. The CI lint job installed ruff with
uv tool install ruff, which floats to the latest release (0.15.17 at the time of writing), while the project lockfile pins ruff 0.14.7. Becausepyproject.tomlsetspreview = true, any new preview rule shipped upstream starts failing the gate without any change in this repository — RUF076 (autouse=Truefixtures) fired onconftest.pyandtests/behaviour/test_stream_backend_pipeline.py, both untouched by the open PRs.Makefile: thefmt,check-fmt, andlinttargets invoke ruff throughuv run, so CI and local runs both resolve the locked version; theruffprobe moves from the PATH tool list (TOOLS) to the virtualenv tool list (VENV_TOOLS)..github/workflows/ci.yml: drop the floatinguv tool install ruff(the lint job already runsmake build, which syncs the locked environment).pylint. The
pylint-pypy-shimgit ref was already pinned, but pylint itself was a floating dependency of it — the same skew class: pylint 4.0.5 started flagging boundstr.formatreferences (consider-using-f-string) overnight, with no repository change. ThePYLINTinvocation now passes--with 'pylint==$(PYLINT_VERSION)'(4.0.5), so bumping pylint becomes an explicit, reviewable change toPYLINT_VERSION.Adopting ruff 0.15.x (and addressing RUF076) is left as a separate, deliberate upgrade.
Testing
make check-fmt,make lint,make typecheck,make testall pass locally with the locked ruff 0.14.7 (viauv run) and pinned pylint 4.0.5🤖 Generated with Claude Code
Summary by Sourcery
Pin Python linters to locked versions and run ruff from the project virtualenv to keep CI and local lint behaviour consistent.
Enhancements:
CI: