Skip to content

ci: adopt ruff, drop pytest-pycodestyle/pytest-pydocstyle#818

Merged
cailmdaley merged 2 commits into
developfrom
fix/ruff-lint-drop-pytest-style
Jul 13, 2026
Merged

ci: adopt ruff, drop pytest-pycodestyle/pytest-pydocstyle#818
cailmdaley merged 2 commits into
developfrom
fix/ruff-lint-drop-pytest-style

Conversation

@cailmdaley

@cailmdaley cailmdaley commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Part of #791.

Why

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 — before collecting a single test:

pluggy._manager.PluginValidationError: Plugin 'pydocstyle' for hook 'pytest_collect_file'
Argument(s) {'path'} are declared in the hookimpl but can not be found in the hookspec

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

  • Replace the entire style-tool stack — 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 format replaces black.
  • Bump pytest 9.0.3 → 9.1.1 in 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.lock regenerated (the image installs via uv 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 check currently reports ~600 findings, including some genuine bugs (undefined names, unused variables, bare except) 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

cailmdaley and others added 2 commits July 13, 2026 11:24
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
@cailmdaley

Copy link
Copy Markdown
Contributor Author

LGTM

@cailmdaley cailmdaley merged commit 50a7345 into develop Jul 13, 2026
3 checks passed
@cailmdaley cailmdaley deleted the fix/ruff-lint-drop-pytest-style branch July 13, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt ruff linting (would have caught the un-raised-exception pattern)

1 participant