ci: adopt ruff, drop pytest-pycodestyle/pytest-pydocstyle#818
Merged
Conversation
pytest 9.1 removed the deprecated `path` argument from the `pytest_collect_file` hookspec. The unmaintained pytest-pydocstyle plugin still declares `path` in its hookimpl, so pytest aborts at plugin registration with PluginValidationError before collecting any test — turning CI red on every dependency PR that bumps pytest to 9.1+ (Renovate #816, #817). These plugins were dead weight: never enabled via flags, never configured, enforcing nothing — they only broke CI because merely installing them registers the incompatible hook. Replace the whole style-tool stack (black, isort, pytest-pycodestyle, pytest-pydocstyle) with ruff, a single maintained tool covering pycodestyle (E/W), Pyflakes (F), import sorting (I), and numpydoc docstrings (D). This unblocks all future pytest bumps. Enforcement is deliberately not wired into CI in this PR (parity with today — no style gate existed): a clean `ruff check` currently reports ~600 findings, including some real bugs (undefined names, unused variables, bare excepts) worth a dedicated follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CBC6HKdgXaZ7ei5XfdvZGo
Locks pytest to the version that exposed the pytest-pydocstyle breakage, so this PR's own CI exercises the exact scenario it fixes (green = proof) and completes the bump Renovate #816/#817 were attempting. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CBC6HKdgXaZ7ei5XfdvZGo
Contributor
Author
|
LGTM |
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.
Part of #791.
Why
pytest 9.1 removed the deprecated
pathargument from thepytest_collect_filehookspec. The unmaintainedpytest-pydocstyleplugin still declarespathin its hookimpl, so pytest aborts at plugin registration — before collecting a single test:This turns CI red on every dependency PR that bumps pytest to 9.1+ — currently Renovate #816 (all-non-major) and #817 (lock maintenance), both of which fail here and nowhere else (the image builds fine).
Crucially, these plugins were dead weight: never enabled via flags, never configured, enforcing nothing. They only broke CI because merely installing them registers the incompatible hook.
What
black,isort,pytest-pycodestyle,pytest-pydocstyle— with ruff, one maintained tool that subsumes all of them: pycodestyle (E/W), Pyflakes (F), import sorting (I, replaces isort), numpydoc docstrings (D).ruff formatreplacesblack.uv.lock, so this PR's own CI exercises the exact scenario it fixes — green CI here is the proof — and completes the bump Renovate was attempting.uv.lockregenerated (the image installs viauv sync --frozen, so the lock must match pyproject): removes black, isort, pycodestyle, pydocstyle, both pytest plugins; adds ruff; bumps pytest.Scope note — no CI gate yet
Enforcement is deliberately not wired into CI in this PR — parity with today, where no style gate existed. A clean
ruff checkcurrently reports ~600 findings, including some genuine bugs (undefined names, unused variables, bareexcept) that deserve a dedicated follow-up rather than being buried in a dependency-unblock PR. This PR's job is to unblock pytest 9.1 and land the maintained ruff foundation; enforcement can be turned on incrementally.Once merged, #816 / #817 rebase clean (their pytest bump is already done here).
🤖 Generated with Claude Code