Replace mypy-protobuf with protobuf pyi_out
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.
Related: https://github.com/nipunn1313/mypy-protobuf/issues/628 and https://github.com/nipunn1313/mypy-protobuf/issues/368#issuecomment-1223884445
It would be interesting to do a side-by-side comparison.
https://github.com/protocolbuffers/protobuf/issues/23670
This is at least one difference.
There are also differences in enum value types that are incompatible across the 2 implementations. So it would be a breaking change.
There is now a somewhat up to date comparison here