danielgtaylor / python-betterproto

Clean, modern, Python 3.6+ code generator & library for Protobuf 3 and async gRPC
MIT License
1.5k stars 209 forks source link

Import Bug - No arguments are generated for stub methods when using `import` with proto definition #23

Closed huan closed 4 years ago

huan commented 4 years ago

If I'm using the import in the proto file, like the following:

https://github.com/huan/python-betterproto-issue/blob/60d232c90c099abca4aea6dc1273121cd4f43d66/proto_with_import/puppet_service.proto#L1-L9

Then the betterproto will fail to generate the argument of the Ding method, like this:

https://github.com/huan/python-betterproto-issue/blob/60d232c90c099abca4aea6dc1273121cd4f43d66/gen_proto_with_import/puppet_grpc.py#L13

As we are expecting this:

https://github.com/huan/python-betterproto-issue/blob/60d232c90c099abca4aea6dc1273121cd4f43d66/gen_proto_without_import/puppet_grpc.py#L21

Reproduce Repo at https://github.com/huan/python-betterproto-issue

boukeversteegh commented 4 years ago

Confirmed this bug and added a test-case f25c66777ac572ba63106802f6e57613bec84781