mypy-protobuf icon indicating copy to clipboard operation
mypy-protobuf copied to clipboard

Compare mypy-protobuf to protobuf --pyi_out support (starting with 3.20)

Open gitpushdashf opened this issue 3 years ago • 7 comments

Has anyone compared this with mypy-protobuf's output? I'm not sure if it supports grpc or not.

gitpushdashf avatar Apr 08 '22 17:04 gitpushdashf

I haven't done a comparison. You're welcome to!

nipunn1313 avatar Apr 16 '22 20:04 nipunn1313

grpc_tools still does not support protobuf 3.20

q0w avatar Jun 09 '22 07:06 q0w

grpc_tools still does not support protobuf 3.20

Is this true? It seemed to be working for me.

I do see that it doesn't support v4 or later, however:

https://github.com/grpc/grpc/blob/v1.46.3/tools/distrib/python/grpcio_tools/setup.py#L293

https://github.com/grpc/grpc/issues/29969

gitpushdashf avatar Jun 09 '22 17:06 gitpushdashf

https://github.com/grpc/grpc/blob/master/tools/distrib/python/grpcio_tools/grpc_version.py i cant use --pyi_out with python -m grpcio_tools.protoc

q0w avatar Jun 09 '22 17:06 q0w

Hmm. This looks related: https://github.com/grpc/grpc/issues/29650

gitpushdashf avatar Jun 09 '22 18:06 gitpushdashf

It doesn't seem production ready yet. mypy gives a bunch of errors running on the --pyi_out generated stubs

ajasmin avatar Jul 27 '22 17:07 ajasmin

this project has spent a bunt of time battle hardening the type stubs and adding tests. AFAICT, the built-in --pyi_out stubs have not. Your mileage may vary.

Might be a nice idea to use the test suites from mypy-protobuf on the built in stubs and see if it uncovers bugs.

nipunn1313 avatar Aug 23 '22 10:08 nipunn1313