Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
c9504715
Commit
c9504715
authored
Nov 22, 2016
by
Feng Xiao
Committed by
GitHub
Nov 22, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2404 from wiktortomczak/master
Support grpc plugin in py_proto_library
parents
b7632464
0fa31b2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
protobuf.bzl
protobuf.bzl
+12
-0
No files found.
protobuf.bzl
View file @
c9504715
...
...
@@ -304,6 +304,7 @@ def py_proto_library(
include
=
None
,
default_runtime
=
"//:protobuf_python"
,
protoc
=
"//:protoc"
,
use_grpc_plugin
=
False
,
**
kargs
):
"""Bazel rule to create a Python protobuf library from proto source files
...
...
@@ -323,6 +324,8 @@ def py_proto_library(
default_runtime: the implicitly default runtime which will be depended on by
the generated py_library target.
protoc: the label of the protocol compiler to generate the sources.
use_grpc_plugin: a flag to indicate whether to call the Python C++ plugin
when processing the proto files.
**kargs: other keyword arguments that are passed to cc_library.
"""
...
...
@@ -332,6 +335,13 @@ def py_proto_library(
if
include
!=
None
:
includes
=
[
include
]
grpc_python_plugin
=
None
if
use_grpc_plugin
:
grpc_python_plugin
=
"//external:grpc_python_plugin"
# Note: Generated grpc code depends on Python grpc module. This dependency
# is not explicitly listed in py_libs. Instead, host system is assumed to
# have grpc installed.
proto_gen
(
name
=
name
+
"_genproto"
,
srcs
=
srcs
,
...
...
@@ -341,6 +351,8 @@ def py_proto_library(
gen_py
=
1
,
outs
=
outs
,
visibility
=
[
"//visibility:public"
],
plugin
=
grpc_python_plugin
,
plugin_language
=
"grpc"
)
if
default_runtime
and
not
default_runtime
in
py_libs
+
deps
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment