Pin ruff to a minor line and split lint from tests in CI - #85
Merged
Conversation
`select = ["ALL"]` with an unpinned ruff let Astral's release cadence decide whether a branch was green: 0.16 added CPY001 and began formatting Python blocks inside Markdown, turning #64 red for six weeks. - Cap ruff to `>=0.16.2,<0.17` in the dev extra, so formatter and rule changes arrive on a bump PR opened deliberately rather than on whichever PR is open. A stale venv now fails the constraint and self-corrects on reinstall. - Split CI into `lint` (once) and `test` (3.11/3.13). Previously both lived in one job, so a failing format step ended the job before pytest ran and fail-fast cancelled the sibling — the six weeks of red carried no test signal at all. Dropping fail-fast alone would not have fixed this. - Echo `ruff --version` in CI, so a version mismatch is visible in the log. - Widen the checked scope from `src/` to `.`, which is clean today and starts enforcing the `scripts/*` rules ruff.toml already configures. - Drop per-file-ignores for paths that no longer exist (`example/*` has no Python files, `API/app.ipynb` is gone) and the spent `PT011` entry. - Record the policy and the upgrade procedure in CONTRIBUTING.md. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
3 tasks
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.
Fixes #79.
Why
select = ["ALL"]with an unpinned ruff gave Astral's release cadence a vote on whether our branches are green. 0.16 addedCPY001and began formatting Python blocks inside Markdown, and #64 went red for six weeks as a result.Worse, the red carried no signal: lint and tests shared one job, so the failing format step ended the job before
pytestran, andfail-fastcancelled the sibling. Note that droppingfail-fastalone would not have fixed this — both matrix jobs run the same format check and would have failed at the same step.What changed
>=0.16.2,<0.17in thedevextra. Formatter and rule changes now arrive on a bump PR opened deliberately, not on whichever PR happens to be open. A venv on 0.15.x now fails the constraint and self-corrects onpip install -e .[dev].select = ["ALL"]stays — with the cap, it's a subscription to work at bump time rather than to surprise.lint(once — ruff's verdict is interpreter-independent,target-versionfixes the syntax target) andtest(3.11/3.13 matrix, pytest only). Lint can no longer gate tests, and ruff runs once instead of twice.ruff --versionechoed in every run, so a version mismatch is visible in the log's first lines instead of costing an investigation.src/to.— clean today, and it starts enforcing thescripts/*rulesruff.tomlalready configures. Tests stay excluded.example/*has zero.pyfiles;API/app.ipynbis gone) and the spentPT011entry (0 hits).pyproject.toml(why the cap exists) andCONTRIBUTING.md(how to raise it).Bumps stay manual and one minor at a time — deliberately no Dependabot: trailing a linter release is harmless, while a bot opening dependency PRs is its own maintenance surface.
How to test
This PR is its own test — the rewritten workflow runs on it, and you should see three independent checks (
Lint,Test Python 3.11,Test Python 3.13) rather than one job whose failure hides the others. TheRuff versionstep reports which 0.16.x the cap resolved to.Locally, from the project venv:
To see the masking fix directly: introduce a formatting error, and confirm the test jobs still run and report.
Not in scope
ruff check tests/reports 390 errors (tests are excluded from linting viaruff.toml).main, so PRs intodevget no CI at all.🤖 Generated with Claude Code