Conversation
A bare `flake8` resolves through PATH and can land in an environment that lacks flake8-black/flake8-isort -- flake8 then exits 0 while silently skipping the black and isort checks CI enforces, and setup.cfg's black-config option goes unread because no plugin registers it. Invoke both flake8 and pip via `python -m` so make lint, make setup and make unittests all bind to one interpreter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HAnuwguSXH8EJ78MYTEWjH
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.
What & why
make lintran the bareflake8console script, which resolves throughPATHand need not be the interpreter
make unittestsandmake setupuse. In thisrepo's web-session container it resolved to a uv tool venv
(
/root/.local/share/uv/tools/flake8/) that had no plugins, whileflake8-blackandflake8-isortwere installed into a different Pythonentirely.
The failure is silent in the worst way: flake8 runs, finds no plugins, checks
only pycodestyle/pyflakes, and exits 0. Both black and isort — the checks CI
actually enforces — are skipped, and
setup.cfg'sblack-config = ./pyproject.tomlis ignored because no plugin registers that option.make lintpasses locally and the lint job fails on the PR.Fix
Invoke through
python -mso the linter binds to the same interpreter aseverything else:
lint: python -m flake8 redbeat testssetuphad the same split — line 1 usedpython -m pip, the next two used abare
pip— so those are nowpython -m piptoo. That inconsistency isplausibly how the two-interpreter state arose in the first place.
Test plan
make lintnow reportsflake8 7.3.0 (flake8-black: 0.4.0, flake8-isort: 7.0.0, …)and exits 0 with the plugins genuinely loaded — verified against ascratch file that
BLK100,I001andI003all fire, and thatskip-string-normalizationfrompyproject.tomlis honored rather than blackrewriting single quotes.
main; nothing reformatted.make testpasses (89 tests).No
CHANGES.txtentry — this is build tooling, not a user-visible change.Note on CI
CI is unaffected:
.github/workflows/ci.ymlinstallsflake8 flake8-black flake8-isortinto the job's only Python and callsflake8directly, so it wasalways running the real checks. This only fixes local/web-session runs, where
the mismatch made
make linta no-op.Generated by Claude Code