grpc_python_plugin

1,129 views
Skip to first unread message

Sean Harger

unread,
Jul 11, 2017, 2:18:30 AM7/11/17
to grp...@googlegroups.com
Is the only suitable way to obtain the grpc_python_plugin (for protoc) to build the library from source? That's what I am currently doing in my project and it seems like a waste of build time.

All the evidence out there seems to suggest that installing grpcio from pip does not include this binary, and I cannot find any official alternatives other than downloading all of GRPC (and its dependencies) and building the grpc_python_plugin directly.

Am I missing something?

Nicolas Noble

unread,
Jul 11, 2017, 3:23:27 AM7/11/17
to Sean Harger, grp...@googlegroups.com
The grpcio package contains a binary that is both protoc and the plugin, all in one. So while it technically doesn't contain a binary called "grpc_python_plugin", you don't need it when using the tools packages we are providing. The point is that you don't need to have any hassle with fiddling with the protoc options.

As an easier comparison point, the nodejs tools package does this for you for instance:


As you can see, calling protoc with the nodejs package automatically injects the plugin for you into the command-line, removing the need to even know about the compiler plugin. This is true for any of the tools packages, including python, which does it in a slightly more complicated way than nodejs.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAGDDvkwNzV8cq2-2eQBYt6miWF0biXO_0vY7ifmMpngyTBvwJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Sean Harger

unread,
Jul 11, 2017, 11:58:07 PM7/11/17
to Nicolas Noble, grp...@googlegroups.com
Nicolas,

I knew that, but what I really am after is to be able to generate all my language targets from one binary. I have a project that includes both Python and Go code, and I want to generate all the GRPC stubs from one call to protoc. Is that possible without doing the process I suggested?

Sean

On Tue, Jul 11, 2017 at 12:23 AM Nicolas Noble <pixel...@gmail.com> wrote:
The grpcio package contains a binary that is both protoc and the plugin, all in one. So while it technically doesn't contain a binary called "grpc_python_plugin", you don't need it when using the tools packages we are providing. The point is that you don't need to have any hassle with fiddling with the protoc options.

As an easier comparison point, the nodejs tools package does this for you for instance:


As you can see, calling protoc with the nodejs package automatically injects the plugin for you into the command-line, removing the need to even know about the compiler plugin. This is true for any of the tools packages, including python, which does it in a slightly more complicated way than nodejs.

On Mon, Jul 10, 2017 at 11:18 PM, Sean Harger <seanha...@gmail.com> wrote:
Is the only suitable way to obtain the grpc_python_plugin (for protoc) to build the library from source? That's what I am currently doing in my project and it seems like a waste of build time.

All the evidence out there seems to suggest that installing grpcio from pip does not include this binary, and I cannot find any official alternatives other than downloading all of GRPC (and its dependencies) and building the grpc_python_plugin directly.

Am I missing something?

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.

Nicolas Noble

unread,
Jul 12, 2017, 12:41:32 AM7/12/17
to Sean Harger, grpc.io, Nicolas Noble
Right. This is indeed a case where the current state of the python tool is bad. 

On Jul 11, 2017 8:58 PM, "Sean Harger" <seanha...@gmail.com> wrote:
Nicolas,

I knew that, but what I really am after is to be able to generate all my language targets from one binary. I have a project that includes both Python and Go code, and I want to generate all the GRPC stubs from one call to protoc. Is that possible without doing the process I suggested?

Sean

On Tue, Jul 11, 2017 at 12:23 AM Nicolas Noble <pixel...@gmail.com> wrote:
The grpcio package contains a binary that is both protoc and the plugin, all in one. So while it technically doesn't contain a binary called "grpc_python_plugin", you don't need it when using the tools packages we are providing. The point is that you don't need to have any hassle with fiddling with the protoc options.

As an easier comparison point, the nodejs tools package does this for you for instance:


As you can see, calling protoc with the nodejs package automatically injects the plugin for you into the command-line, removing the need to even know about the compiler plugin. This is true for any of the tools packages, including python, which does it in a slightly more complicated way than nodejs.

On Mon, Jul 10, 2017 at 11:18 PM, Sean Harger <seanha...@gmail.com> wrote:
Is the only suitable way to obtain the grpc_python_plugin (for protoc) to build the library from source? That's what I am currently doing in my project and it seems like a waste of build time.

All the evidence out there seems to suggest that installing grpcio from pip does not include this binary, and I cannot find any official alternatives other than downloading all of GRPC (and its dependencies) and building the grpc_python_plugin directly.

Am I missing something?

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.

Nathaniel Manista

unread,
Jul 16, 2017, 3:03:09 PM7/16/17
to Sean Harger, grp...@googlegroups.com
On Mon, Jul 10, 2017 at 11:18 PM, Sean Harger <seanha...@gmail.com> wrote:
You may be missing the grpcio-tools package which contains the grpc_python_plugin embedded within it.
-Nathaniel

Nathaniel Manista

unread,
Jul 16, 2017, 3:06:49 PM7/16/17
to Sean Harger, Nicolas Noble, grp...@googlegroups.com
On Tue, Jul 11, 2017 at 8:57 PM, Sean Harger <seanha...@gmail.com> wrote:
I knew that, but what I really am after is to be able to generate all my language targets from one binary. I have a project that includes both Python and Go code, and I want to generate all the GRPC stubs from one call to protoc. Is that possible without doing the process I suggested?

It is not currently possible to generate code in non-Python languages with a single Python-language function call to grpc_tools, but you're neither the first nor second to ask. Please add your comments and support to issue 8135?
-Nathaniel
Reply all
Reply to author
Forward
0 new messages