question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin does not generate gRPC stubs to *_pb2_grpc.py

See original GitHub issue

Starting from some version of the protoc compiler, gRPC service stubs are no longer generated into *_pb2.py files. Now they are generated into separate *_pb2_grpc.py files. So to properly support grpcio library *_pb2_grpc.pyi files should be generated for service stubs.

And it would be great to generate gRPC stubs optionally, this would be possible if two separate CLI options (plugins) for protoc were created:

  • --mypy_out for messages
  • --mypy_gprc_out for gRPC stubs

I’m asking for this feature because I’m the author of the grpclib library, which is an alternative gRPC implementation for asyncio, and users of this library don’t need gRPC stubs for grpcio.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

14reactions
chadrikcommented, Sep 18, 2019

This project has been a life-saver so far even without grpc support, but I’d love to see this issue resolved!

7reactions
nipunn1313commented, Jan 31, 2021

@Evgenus worked on a grpc-stubs implementation - which is now landed on master and will get into the next release

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plugin does not generate gRPC stubs to *_pb2_grpc.py #46
Starting from some version of the protoc compiler, gRPC service stubs are no longer generated into *_pb2.py files. Now they are generated ......
Read more >
Generated-code reference | Python
Generated -code reference. gRPC Python relies on the protocol buffers compiler ( protoc ) to generate code. It uses a plugin to supplement...
Read more >
service without gRPC
You need to invoke the grpc plugin. The default protoc tool does not generate gRPC stubs on it's own. Here's what it looks...
Read more >
Getting started with GRPC python Docker Creating ... - YouTube
Your browser can't play this video. Learn more. Switch camera ... Getting started with GRPC python Docker Creating Fast Backend in Http 2....
Read more >
protocol buffers - protoc not generating service stub files
The command line you are showing does not enable the grpc plugin. You need to specify an _out argument for the grpc plugin,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found