Skip to content

Commit 2657e88

Browse files
committed
Add py_proto_library support
1 parent 7eb4db1 commit 2657e88

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

WORKSPACE

+13-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ http_archive(
2020

2121
http_archive(
2222
name = "rules_proto",
23-
sha256 = "e017528fd1c91c5a33f15493e3a398181a9e821a804eb7ff5acdd1d2d6c2b18d",
24-
strip_prefix = "rules_proto-4.0.0-3.20.0",
23+
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
24+
strip_prefix = "rules_proto-5.3.0-21.7",
2525
urls = [
26-
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0-3.20.0.tar.gz",
26+
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
2727
],
2828
)
2929

@@ -81,10 +81,19 @@ http_archive(
8181
urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"],
8282
)
8383

84+
# rules-python
85+
http_archive(
86+
name = "rules_python",
87+
sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b",
88+
strip_prefix = "rules_python-0.26.0",
89+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz",
90+
)
91+
8492
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
8593
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
8694
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
8795
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
96+
load("@rules_python//python:repositories.bzl", "py_repositories")
8897
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
8998

9099
switched_rules_by_language(
@@ -140,6 +149,7 @@ go_repository(
140149
go_rules_dependencies()
141150
go_register_toolchains(version = "1.19.1")
142151
gazelle_dependencies()
152+
py_repositories()
143153
rules_proto_dependencies()
144154
rules_proto_toolchains()
145155
protobuf_deps()

proto/cel/expr/BUILD.bazel

+35
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,38 @@ cc_proto_library(
206206
name = "explain_cc_proto",
207207
deps = [":explain_proto"],
208208
)
209+
210+
###############################################################################
211+
## Python
212+
###############################################################################
213+
load("@rules_python//python:proto.bzl", "py_proto_library")
214+
215+
py_proto_library(
216+
name = "expr_py_pb2",
217+
deps = [":expr_proto"],
218+
)
219+
220+
py_proto_library(
221+
name = "syntax_py_pb2",
222+
deps = [":syntax_proto"],
223+
)
224+
225+
py_proto_library(
226+
name = "checked_py_pb2",
227+
deps = [":checked_proto"],
228+
)
229+
230+
py_proto_library(
231+
name = "value_py_pb2",
232+
deps = [":value_proto"],
233+
)
234+
235+
py_proto_library(
236+
name = "eval_py_pb2",
237+
deps = [":eval_proto"],
238+
)
239+
240+
py_proto_library(
241+
name = "explain_py_pb2",
242+
deps = [":explain_proto"],
243+
)

0 commit comments

Comments
 (0)