def METHOD_NAME(name, proto, deps = [], **kwargs):
    if not name.endswith("_pl_py_proto"):
        fail("Expected pl_py_proto_library name to end with '_pl_py_proto'.")
    codegen_py_pb_target = _py_proto_library(name, proto)
    py_library(
        name = name,
        srcs = [codegen_py_pb_target],
        deps = deps,
        **kwargs
    )