fix(ci): add --extra dev to pre-commit mypy hook to include types-protobuf stubs#431
Draft
fix(ci): add --extra dev to pre-commit mypy hook to include types-protobuf stubs#431
Conversation
…ubs are present Without --extra dev, uv run mypy does not activate [project.optional-dependencies] dev, which contains types-protobuf. This causes 96 false-positive a2a/protobuf errors locally that don't appear in CI (which installs dev extras explicitly). Pre-commit hooks were routinely bypassed with SKIP=mypy, defeating the type-checking gate entirely. https://claude.ai/code/session_012s2eENfKoeaeeHUyV7Rd9y
3 tasks
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.
Closes #411
Without
--extra dev,uv run mypydoes not activate[project.optional-dependencies] dev, which containstypes-protobuf. The missing stubs cause 96 false-positive errors froma2a/google.protobufimports inclient.pyandprotocols/a2a.py. CI passes cleanly because it installs dev extras explicitly (pip install -e ".[dev]"). Adding--extra devmakes the pre-commit environment match CI so the hook no longer needs routineSKIP=mypybypasses.What was tested:
uv run --extra dev pytest tests/ -q(excluding the pre-existing network-bound signing testtest_real_tls_handshake_still_validates_hostname): 3188 passed, 26 skipped, 1 xfailedmainbefore this change (unrelated: real TLS call toexample.comreturns 403 in the sandbox)Pre-PR review:
types-protobufis duplicated in both[project.optional-dependencies] devand[dependency-groups] dev;--extra devis the correct flag to activate the former (where CI installs from)--group devis the more semantically idiomatic uv flag sinceuv add --devwrites to[dependency-groups]; both flags work today because the stub is duplicated in both sections; inline comment is sufficientSession: https://claude.ai/code/session_012s2eENfKoeaeeHUyV7Rd9y
Generated by Claude Code