Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit d5d8095

Browse files
authored
Add py_proto_library() rules for envoy/api. (#194)
1 parent 7d01b0b commit d5d8095

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/WORKSPACE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,16 @@ git_repository(
7575
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
7676
go_rules_dependencies()
7777
go_register_toolchains()
78+
79+
# py rules related
80+
http_archive(
81+
name = "six_archive",
82+
build_file = "@com_google_protobuf//:six.BUILD",
83+
sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
84+
urls = ["https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55"],
85+
)
86+
87+
bind(
88+
name = "six",
89+
actual = "@six_archive//:six",
90+
)

src/opencensus/proto/resource/v1/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package(default_visibility = ["//visibility:public"])
1616

1717
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
18+
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
1819

1920
proto_library(
2021
name = "resource_proto",
@@ -36,3 +37,8 @@ go_proto_library(
3637
proto = ":resource_proto",
3738
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1",
3839
)
40+
41+
py_proto_library(
42+
name = "resource_proto_py",
43+
srcs = ["resource.proto"],
44+
)

src/opencensus/proto/trace/v1/BUILD.bazel

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package(default_visibility = ["//visibility:public"])
1616

1717
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
1818
load("@io_bazel_rules_go//go:def.bzl", "go_library")
19+
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
1920

2021
proto_library(
2122
name = "trace_proto",
@@ -69,6 +70,20 @@ go_proto_library(
6970
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1",
7071
)
7172

73+
py_proto_library(
74+
name = "trace_proto_py",
75+
srcs = ["trace.proto"],
76+
deps = [
77+
"@com_google_protobuf//:protobuf_python",
78+
"//opencensus/proto/resource/v1:resource_proto_py",
79+
],
80+
)
81+
82+
py_proto_library(
83+
name = "trace_config_proto_py",
84+
srcs = ["trace_config.proto"],
85+
)
86+
7287
# This a workaround because `trace_proto_go` and `trace_config_proto_go` have
7388
# the same importpath, and so cause a compile issue if both are depended on
7489
# directly by another `go_proto_library` (such as `trace_service_proto_go`).

0 commit comments

Comments
 (0)