aboutsummaryrefslogtreecommitdiff
path: root/tools/distrib/python/xds_protos/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/distrib/python/xds_protos/build.py')
-rw-r--r--tools/distrib/python/xds_protos/build.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/distrib/python/xds_protos/build.py b/tools/distrib/python/xds_protos/build.py
index 8b793f2bc8..6434272bc7 100644
--- a/tools/distrib/python/xds_protos/build.py
+++ b/tools/distrib/python/xds_protos/build.py
@@ -15,8 +15,9 @@
"""Builds the content of xds-protos package"""
import os
-import pkg_resources
+
from grpc_tools import protoc
+import pkg_resources
# We might not want to compile all the protos
EXCLUDE_PROTO_PACKAGES_LIST = [
@@ -35,6 +36,8 @@ GOOGLEAPIS_ROOT = os.path.join(GRPC_ROOT, 'third_party', 'googleapis')
VALIDATE_ROOT = os.path.join(GRPC_ROOT, 'third_party', 'protoc-gen-validate')
OPENCENSUS_PROTO_ROOT = os.path.join(GRPC_ROOT, 'third_party',
'opencensus-proto', 'src')
+OPENTELEMETRY_PROTO_ROOT = os.path.join(GRPC_ROOT, 'third_party',
+ 'opentelemetry')
WELL_KNOWN_PROTOS_INCLUDE = pkg_resources.resource_filename(
'grpc_tools', '_proto')
OUTPUT_PATH = WORK_DIR
@@ -67,6 +70,7 @@ COMPILE_PROTO_ONLY = [
'--proto_path={}'.format(VALIDATE_ROOT),
'--proto_path={}'.format(WELL_KNOWN_PROTOS_INCLUDE),
'--proto_path={}'.format(OPENCENSUS_PROTO_ROOT),
+ '--proto_path={}'.format(OPENTELEMETRY_PROTO_ROOT),
'--python_out={}'.format(OUTPUT_PATH),
]
COMPILE_BOTH = COMPILE_PROTO_ONLY + ['--grpc_python_out={}'.format(OUTPUT_PATH)]
@@ -120,11 +124,13 @@ def main():
compile_protos(GOOGLEAPIS_ROOT, os.path.join('google', 'type'))
compile_protos(VALIDATE_ROOT, 'validate')
compile_protos(OPENCENSUS_PROTO_ROOT)
+ compile_protos(OPENTELEMETRY_PROTO_ROOT)
# Generate __init__.py files for all modules
create_init_file(WORK_DIR)
for proto_root_module in [
- 'envoy', 'google', 'opencensus', 'udpa', 'validate', 'xds'
+ 'envoy', 'google', 'opencensus', 'udpa', 'validate', 'xds',
+ 'opentelemetry'
]:
for root, _, _ in os.walk(os.path.join(WORK_DIR, proto_root_module)):
package_path = os.path.relpath(root, WORK_DIR)