fix(lint): unblock develop's lint pipeline#1092
Merged
Merged
Conversation
Two pre-existing lint reds on develop, caused by toolchain drift since the last green run (2026-01-29). Develop's source is otherwise byte- identical to the last passing commit. - pipenv-verify: regenerate Pipfile.lock under current pipenv. The lock was produced by an older pipenv whose Pipfile-hashing differs from what `pipenv verify` computes today, even though Pipfile is unchanged. Lock now matches `pipenv verify` cleanly. Dependency versions are bumped to current point releases as a side effect. - mypy: widen `QDataStreamProtocol.pack_block` to accept `bytes | bytearray`. Newer mypy releases (pulled via the unpinned jpetrucciani/mypy-check@master action) no longer accept passing a `bytearray` to a `bytes` parameter, and `pack_message` builds its argument as a `bytearray`. Cast back to `bytes` at return so the declared return type still holds for both inputs. `pipenv verify`, `mypy server/ main.py`, and `tests/unit_tests/test_protocol.py` are clean locally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe Changespack_block input type flexibility
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The regenerated lock from the previous commit dropped `greenlet`. Older pipenv resolved SQLAlchemy's conditional `greenlet` marker eagerly; current pipenv only includes it when the `asyncio` extra is requested. Without it, every test that touches an async DB session fails with `ValueError: the greenlet library is required to use this function`. Declare the dependency explicitly via `sqlalchemy[asyncio]` so the lock carries `greenlet` regardless of how pipenv interprets the underlying marker. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Two
Lintworkflow steps have been red ondevelopfor months even though the source code hasn't changed since the last green run (commite36de71a, 2026-01-29). Both reds are toolchain drift via unpinned/loosely-pinned external tools, not real issues in the repo:pipenv-verify— workflow doespip install pipenv(no version pin).pipenv verifyrecomputes a SHA-256 ofPipfileand compares it to_meta.hash.sha256inPipfile.lock. The current pipenv normalizes the Pipfile differently from the version that produced the lock, so the hashes diverge even thoughPipfileis unchanged. Fixed by regeneratingPipfile.lockunder current pipenv. Dependency versions get bumped to current point releases as a side effect (e.g. sqlalchemy 2.0.43 → 2.0.50, aiohttp 3.12.15 → 3.14.1, cryptography 46.0.1 → 48.0.1).mypy— workflow usesjpetrucciani/mypy-check@master(unpinned action, latest mypy at run time).QDataStreamProtocol.pack_messagebuilds abytearrayand passes it topack_block(block: bytes). Older mypy implicitly accepted that; current mypy raises[arg-type]. Fixed by widening the signature tobytes | bytearrayand casting back tobytesat return so the declared return type still holds for both inputs.Greenlet follow-up
The first lock regeneration silently dropped
greenlet, which broke the fullTestworkflow (ValueError: the greenlet library is required to use this function. No module named 'greenlet') on every test that opens an async DB session. Root cause: older pipenv eagerly resolved SQLAlchemy's conditionalgreenletmarker; current pipenv only pulls it in when theasyncioextra is requested. Fixed by declaring the dependency explicitly:so the lock carries
greenletregardless of how pipenv interprets the underlying marker. Verified locally: SQLAlchemy async dialect now loads with no greenlet error.Verification
pipenv verify→ "Pipfile.lock is up-to-date."mypy --disable-error-code=annotation-unchecked --follow-untyped-imports --strict-equality --warn-redundant-casts --warn-unused-ignores server/ main.py→ "Success: no issues found in 75 source files"pytest tests/unit_tests/test_protocol.py→ 16 passedValueErrorTest plan
Lintworkflow goes fully green (isort, flake8, mypy, pipenv-verify)Testworkflow stays green (no greenlet error, no behavior change frompack_blockwidening)Follow-up suggestion (out of scope)
Both reds will recur as the tools keep moving. Worth pinning
pipenvinpipenv-verifyand replacingjpetrucciani/mypy-check@masterwith a tag, so toolchain bumps land via explicit PR rather than silently breaking CI on unrelated branches.🤖 Generated with Claude Code