[Release] Upmerge v1.55.x branch into master (#33277)

Change was created by the release automation script. See go/grpc-release

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: Yash Tibrewal <yashkt@google.com>
Co-authored-by: Esun Kim <veblush@google.com>
Co-authored-by: Mark D. Roth <roth@google.com>
Co-authored-by: Yousuk Seung <ysseung@google.com>
Co-authored-by: Craig Tiller <ctiller@google.com>
Co-authored-by: Richard Belleville <rbellevi@google.com>
Co-authored-by: gnossen <gnossen@users.noreply.github.com>
pull/33282/head
Yijie Ma 2 years ago committed by GitHub
parent c5ade3011a
commit 10001d16a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 42
      bazel/protobuf.bzl
  2. 5
      bazel/python_rules.bzl
  3. 10
      test/distrib/bazel/python/BUILD

@ -18,24 +18,36 @@ load("@rules_proto//proto:defs.bzl", "ProtoInfo")
_PROTO_EXTENSION = ".proto"
_VIRTUAL_IMPORTS = "/_virtual_imports/"
_WELL_KNOWN_PROTOS_BASE = [
"any_proto",
"api_proto",
"compiler_plugin_proto",
"descriptor_proto",
"duration_proto",
"empty_proto",
"field_mask_proto",
"source_context_proto",
"struct_proto",
"timestamp_proto",
"type_proto",
"wrappers_proto",
]
def well_known_proto_libs():
return [
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:api_proto",
"@com_google_protobuf//:compiler_plugin_proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:source_context_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:type_proto",
"@com_google_protobuf//:wrappers_proto",
]
return ["@com_google_protobuf//:" + b for b in _WELL_KNOWN_PROTOS_BASE]
def is_well_known(label):
return label in well_known_proto_libs()
# Bazel surfaces labels as their undelying identity, even if they are referenced
# via aliases. Bazel also does not currently provide a way to find the real label
# underlying an alias. So the implementation detail that the WKTs present at the
# top level of the protobuf repo are actually backed by targets in the
# //src/google/protobuf package leaks through here.
# We include both the alias path and the underlying path to be resilient to
# reversions of this change as well as for continuing compatiblity with repos
# that happen to pull in older versions of protobuf.
all_wkt_targets = (["@com_google_protobuf//:" + b for b in _WELL_KNOWN_PROTOS_BASE] +
["@com_google_protobuf//src/google/protobuf:" + b for b in _WELL_KNOWN_PROTOS_BASE])
return label in all_wkt_targets
def get_proto_root(workspace_root):
"""Gets the root protobuf directory.

@ -48,7 +48,10 @@ def _gen_py_aspect_impl(target, context):
# Early return for well-known protos.
if is_well_known(str(context.label)):
return [
PyProtoInfo(py_info = context.attr._protobuf_library[PyInfo]),
PyProtoInfo(
py_info = context.attr._protobuf_library[PyInfo],
generated_py_srcs = [],
),
]
protos = []

@ -67,11 +67,6 @@ py_test(
srcs = ["helloworld.py"],
main = "helloworld.py",
python_version = "PY3",
tags = [
# TODO(jtattermusch): Remove the "manual" tag to run on CI again once
# https://github.com/grpc/grpc/issues/32778 is fixed.
"manual",
],
deps = [
":duration_py_pb2",
":helloworld_py_pb2",
@ -113,11 +108,6 @@ py_test(
srcs = ["helloworld_moved.py"],
main = "helloworld_moved.py",
python_version = "PY3",
tags = [
# TODO(jtattermusch): Remove the "manual" tag to run on CI again once
# https://github.com/grpc/grpc/issues/32778 is fixed.
"manual",
],
deps = [
":duration_py_pb2",
":helloworld_moved_py_pb2",

Loading…
Cancel
Save