Add py_proto_library() rules for envoy/api. (#194)

pull/172/merge
easy 6 years ago committed by GitHub
parent 7d01b0b78a
commit d5d80953a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/WORKSPACE
  2. 6
      src/opencensus/proto/resource/v1/BUILD.bazel
  3. 15
      src/opencensus/proto/trace/v1/BUILD.bazel

@ -75,3 +75,16 @@ git_repository(
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
# py rules related
http_archive(
name = "six_archive",
build_file = "@com_google_protobuf//:six.BUILD",
sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
urls = ["https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55"],
)
bind(
name = "six",
actual = "@six_archive//:six",
)

@ -15,6 +15,7 @@
package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
proto_library(
name = "resource_proto",
@ -36,3 +37,8 @@ go_proto_library(
proto = ":resource_proto",
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1",
)
py_proto_library(
name = "resource_proto_py",
srcs = ["resource.proto"],
)

@ -16,6 +16,7 @@ package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
proto_library(
name = "trace_proto",
@ -69,6 +70,20 @@ go_proto_library(
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1",
)
py_proto_library(
name = "trace_proto_py",
srcs = ["trace.proto"],
deps = [
"@com_google_protobuf//:protobuf_python",
"//opencensus/proto/resource/v1:resource_proto_py",
],
)
py_proto_library(
name = "trace_config_proto_py",
srcs = ["trace_config.proto"],
)
# This a workaround because `trace_proto_go` and `trace_config_proto_go` have
# the same importpath, and so cause a compile issue if both are depended on
# directly by another `go_proto_library` (such as `trace_service_proto_go`).

Loading…
Cancel
Save