blob: dbb469d0e9efe3eee7862e5770f829c395fcbbeb [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" if "protos" in kwargs else "deps"] + proto_compile_attrs.keys()
} # Forward args
)
# Create python library
py_library(
name = name,
srcs = [name_pb],
deps = GRPC_DEPS + (kwargs.get("deps", []) if "protos" in kwargs else []),
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",
]