blob: b103d77fb1b23f7fd65e07af5a69eb83850e4176 [file]
"""Generated definition of python_grpc_library."""
load("//python:python_grpc_compile.bzl", "python_grpc_compile")
load("//internal:compile.bzl", "proto_compile_attrs")
load("@rules_python//python:defs.bzl", "py_library")
def python_grpc_library(name, **kwargs):
# Compile protos
name_pb = name + "_pb"
python_grpc_compile(
name = name_pb,
**{
k: v
for (k, v) in kwargs.items()
if k in ["protos"] + proto_compile_attrs.keys()
} # Forward args
)
# Create python library
py_library(
name = name,
srcs = [name_pb],
deps = GRPC_DEPS + kwargs.get("deps", []),
imports = [name_pb],
visibility = kwargs.get("visibility"),
tags = kwargs.get("tags"),
)
GRPC_DEPS = [
"@com_google_protobuf//:protobuf_python",
"@com_github_grpc_grpc//src/python/grpcio/grpc:grpcio",
]