Replace mypy-protobuf with protobuf pyi_out
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 2.1k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 82
Description
I noticed that pyi_out is a lot cleaner and more readable that mypy-protobuf. Since pyi generation is part of protobuf it is probably prefered instead of unofficial mypy_protobuf.
And there is also one interesting sideeffect that enums constants are not compatible between themselves exposing couple of bugs in our code.
For example:
enum EnumA {
A_A = 0;
A_B = 1;
}
enum EnumB {
B_A = 0;
B_B = 1;
}
message Msg {
EnumA name = 1;
}
mypy is not bothered that name can also be used with B_A and B_B. But it works with pyi_out generated code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the repository configuration or scripts that invoke mypy-protobuf and inspect how generated Python stubs are used. Compare the current output with protobuf's pyi_out behavior, then verify that the replacement preserves the expected stubs and prevents incompatible enum constants from being accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100