chirpstack-api icon indicating copy to clipboard operation
chirpstack-api copied to clipboard

Use protoc mypy plugin to generate type stubs

Open ldorigo opened this issue 2 years ago • 3 comments

This makes the developer experience much nicer for people using static type checkers (mypy of pylance). Addresses my comment in https://github.com/brocaar/chirpstack-api/issues/54 .

Note that the makefile failed for me, I had to change grpc_python_out to python_grpc_out - not sure why? Maybe the name changed in a recent version of grpcio.

ldorigo avatar Dec 07 '22 09:12 ldorigo

It's unclear why there are so many new files - maybe not everything in /src has to be included in git?

ldorigo avatar Dec 07 '22 09:12 ldorigo

It looks like grpc-generated files are called xxx_grpc rather than _pb2_grpc. Probably the original files were generated as protobuf 2, which is now replaced?

ldorigo avatar Dec 07 '22 09:12 ldorigo

I removed the extra files, please check this is correct

ldorigo avatar Dec 07 '22 09:12 ldorigo