Skip to content

Remove unused pytest-black/pytest-isort dev deps that broke unit-test CI#267

Open
bennett-elder wants to merge 2 commits into
mainfrom
chore/remove-broken-pytest-plugins
Open

Remove unused pytest-black/pytest-isort dev deps that broke unit-test CI#267
bennett-elder wants to merge 2 commits into
mainfrom
chore/remove-broken-pytest-plugins

Conversation

@bennett-elder

Copy link
Copy Markdown
Contributor

Describe Changes

Unit-test CI currently fails at pytest startup, before any test runs:

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

Root cause: pytest-black (and pytest-isort) are unmaintained and still implement the old pytest_collect_file(file_path, path, parent) hook; modern pytest removed the path argument, so a fresh install resolving current pytest crashes during plugin registration. Both were unpinned in the test extra, so this is a time-bomb that triggered once a newer pytest released.

These plugins were also never actually invoked — there is no --black/--isort in addopts, and they are referenced nowhere except their own dependency lines. Formatting/lint is handled by ruff (already a dev dependency and run in the Quality workflow).

This PR removes pytest-black and pytest-isort from the test extra. No behavioral change to what is tested; CI collection no longer crashes.

Verification

With both plugins uninstalled locally (simulating a fresh CI env) and current pytest 9.1.0:

pytest src -m unit  →  284 passed, 113 deselected

No -p no:black workaround required.

Link to Issues

N/A — CI infrastructure fix.

PR Review Checklist

  • Thoroughly reviewed on local machine.
  • Have you added any tests — N/A; this removes broken, unused test plugins. Verified the full unit suite passes (284 passed).
  • Make sure to note changes in Changelog

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Remove unused pytest-black/pytest-isort to fix pytest startup failure in CI
🐞 Bug fix ⚙️ Configuration changes 📝 Documentation 🕐 Less than 10 minutes

Grey Divider

Description

• Remove unmaintained pytest plugins that crash during plugin registration on modern pytest.
• Keep formatting/linting responsibility with ruff; no test behavior changes.
• Document the CI fix in the changelog for release visibility.
Diagram

graph TD
  A["Unit-test CI"] --> B["Install 'test' extra"] --> C["pyproject.toml"] --> D["pytest startup"] --> E["Plugin registration"]
  C --> F["Remove pytest-black/isort"] --> D
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pin pytest (or pytest-black/isort) to known-compatible versions
  • ➕ Keeps historical tooling available if anyone relied on it implicitly
  • ➖ Still carries unmaintained plugins and future break risk
  • ➖ Requires ongoing pin management and conflicts with fresh installs/security updates
2. Disable the plugins explicitly in CI (e.g., `-p no:black -p no:isort`)
  • ➕ Fast mitigation without changing dependency lists
  • ➖ Leaves the broken packages installed (still a time-bomb for other environments)
  • ➖ Adds CI-only knowledge and maintenance overhead
3. Replace with maintained formatter checks (ruff format/isort-equivalent) as part of tests
  • ➕ Modern, maintained tooling aligned with current ecosystem
  • ➖ Broader workflow change; may require new configuration and developer retraining

Recommendation: Removing pytest-black/pytest-isort from the test extra is the best approach because they were unused, unmaintained, and actively breaking pytest startup due to an incompatible hook signature. Pinning or CI-disabling would only mask the underlying fragility while keeping dead dependencies in the environment; relying on ruff for formatting/lint keeps responsibilities clear and avoids plugin-time failures.

Files changed (2) +1 / -2

Documentation (1) +1 / -0
CHANGELOG.mdDocument CI fix for pytest startup crash +1/-0

Document CI fix for pytest startup crash

• Adds a 'Fixed' changelog entry explaining that unit-test CI failed at pytest startup due to unmaintained 'pytest-black'/'pytest-isort' using an outdated hook signature. Notes that formatting/lint is handled by 'ruff' and that the plugins were unused.

CHANGELOG.md

Other (1) +0 / -2
pyproject.tomlDrop pytest-black and pytest-isort from the test extra +0/-2

Drop pytest-black and pytest-isort from the test extra

• Removes 'pytest-black' and 'pytest-isort' from the 'test' optional dependency list to prevent Pluggy/pytest plugin validation failures on newer pytest releases. Keeps the rest of the unit-test toolchain unchanged.

pyproject.toml

@duploctl

duploctl Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
3778 1501 40% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: d295d2c by action🐍

@qodo-code-review

qodo-code-review Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Changelog entry is run-on ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The added CHANGELOG entry is a single long, run-on sentence without a final period, which reduces
readability and professionalism in user-facing documentation. This can make release notes harder to
scan and understand.
Code

CHANGELOG.md[18]

+- Fixed unit-test CI failing at pytest startup (`PluginValidationError: Plugin 'black' ... Argument(s) {'path'} ... can not be found in the hookspec`) by removing the unused, unmaintained `pytest-black` and `pytest-isort` dev dependencies. They were never invoked (no `--black`/`--isort` in `addopts`) and their old `pytest_collect_file` hook signature is incompatible with current pytest; formatting/lint is handled by `ruff`
Evidence
PR Compliance ID 5 requires user-facing documentation/messages to be accurate and professional. The
added CHANGELOG line is a long run-on entry and appears to omit final punctuation, which is a
documentation quality issue.

CHANGELOG.md[18-18]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly added CHANGELOG entry is overly long/run-on and lacks final punctuation, reducing readability and professionalism.
## Issue Context
This is user-facing release documentation and should be concise and easy to scan.
## Fix Focus Areas
- CHANGELOG.md[18-18]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@bennett-elder bennett-elder requested a review from kferrone June 18, 2026 17:41

@kferrone kferrone left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

2 participants