|
|
@ -36,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') |
|
|
|
VALIDATE_ROOT = os.path.join(GRPC_ROOT, 'third_party', 'protoc-gen-validate') |
|
|
|
OPENCENSUS_PROTO_ROOT = os.path.join(GRPC_ROOT, 'third_party', |
|
|
|
OPENCENSUS_PROTO_ROOT = os.path.join(GRPC_ROOT, 'third_party', |
|
|
|
'opencensus-proto', 'src') |
|
|
|
'opencensus-proto', 'src') |
|
|
|
|
|
|
|
OPENTELEMETRY_PROTO_ROOT = os.path.join(GRPC_ROOT, 'third_party', |
|
|
|
|
|
|
|
'opentelemetry') |
|
|
|
WELL_KNOWN_PROTOS_INCLUDE = pkg_resources.resource_filename( |
|
|
|
WELL_KNOWN_PROTOS_INCLUDE = pkg_resources.resource_filename( |
|
|
|
'grpc_tools', '_proto') |
|
|
|
'grpc_tools', '_proto') |
|
|
|
OUTPUT_PATH = WORK_DIR |
|
|
|
OUTPUT_PATH = WORK_DIR |
|
|
@ -68,6 +70,7 @@ COMPILE_PROTO_ONLY = [ |
|
|
|
'--proto_path={}'.format(VALIDATE_ROOT), |
|
|
|
'--proto_path={}'.format(VALIDATE_ROOT), |
|
|
|
'--proto_path={}'.format(WELL_KNOWN_PROTOS_INCLUDE), |
|
|
|
'--proto_path={}'.format(WELL_KNOWN_PROTOS_INCLUDE), |
|
|
|
'--proto_path={}'.format(OPENCENSUS_PROTO_ROOT), |
|
|
|
'--proto_path={}'.format(OPENCENSUS_PROTO_ROOT), |
|
|
|
|
|
|
|
'--proto_path={}'.format(OPENTELEMETRY_PROTO_ROOT), |
|
|
|
'--python_out={}'.format(OUTPUT_PATH), |
|
|
|
'--python_out={}'.format(OUTPUT_PATH), |
|
|
|
] |
|
|
|
] |
|
|
|
COMPILE_BOTH = COMPILE_PROTO_ONLY + ['--grpc_python_out={}'.format(OUTPUT_PATH)] |
|
|
|
COMPILE_BOTH = COMPILE_PROTO_ONLY + ['--grpc_python_out={}'.format(OUTPUT_PATH)] |
|
|
@ -121,11 +124,13 @@ def main(): |
|
|
|
compile_protos(GOOGLEAPIS_ROOT, os.path.join('google', 'type')) |
|
|
|
compile_protos(GOOGLEAPIS_ROOT, os.path.join('google', 'type')) |
|
|
|
compile_protos(VALIDATE_ROOT, 'validate') |
|
|
|
compile_protos(VALIDATE_ROOT, 'validate') |
|
|
|
compile_protos(OPENCENSUS_PROTO_ROOT) |
|
|
|
compile_protos(OPENCENSUS_PROTO_ROOT) |
|
|
|
|
|
|
|
compile_protos(OPENTELEMETRY_PROTO_ROOT) |
|
|
|
|
|
|
|
|
|
|
|
# Generate __init__.py files for all modules |
|
|
|
# Generate __init__.py files for all modules |
|
|
|
create_init_file(WORK_DIR) |
|
|
|
create_init_file(WORK_DIR) |
|
|
|
for proto_root_module in [ |
|
|
|
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)): |
|
|
|
for root, _, _ in os.walk(os.path.join(WORK_DIR, proto_root_module)): |
|
|
|
package_path = os.path.relpath(root, WORK_DIR) |
|
|
|
package_path = os.path.relpath(root, WORK_DIR) |
|
|
|