Skip to content

Commit

Permalink
chore: Migrate python-monitoring-dashboards synth.py from artman to b…
Browse files Browse the repository at this point in the history
…azel (#13)

Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
  • Loading branch information
vam-google and busunkim96 authored Jun 3, 2020
1 parent a53aaaf commit b2f8ed8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/google-cloud-monitoring-dashboards/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@
# Generate monitoring dashboards GAPIC layer
# ----------------------------------------------------------------------------
library = gapic.py_library(
"monitoring-dashboard", "v1", proto_path="/google/monitoring/dashboard/v1"
service="monitoring_dashboard",
version="v1",
bazel_target="//google/monitoring/dashboard/v1:monitoring-dashboard-v1-py",
include_protos=True,
proto_output_path="google/cloud/monitoring_dashboard/v1/proto",
)

s.move(
library,
excludes=[
"google/cloud/monitoring/dashboard_v1/proto", # Protos (pb2s) are copied to the incorrect location
"google/cloud/monitoring_dashboard_v1/proto", # Protos (pb2s) are copied to the incorrect location
"nox.py",
"README.rst",
"setup.py",
Expand All @@ -39,7 +43,7 @@
)

s.move(
library / "google/cloud/monitoring/dashboard_v1/proto",
library / "google/cloud/monitoring_dashboard_v1/proto",
"google/cloud/monitoring_dashboard/v1/proto",
)

Expand All @@ -50,8 +54,8 @@
# Fix imports
s.replace(
"google/cloud/**/proto/*_pb2*.py",
"from google\.cloud\.monitoring\.dashboard\_v1\.proto",
"from google.cloud.monitoring_dashboard.v1.proto",
"google\.cloud\.monitoring\_dashboard\_v1\.proto",
"google.cloud.monitoring_dashboard.v1.proto",
)

# Fix docstring with trailing backticks
Expand All @@ -65,7 +69,7 @@

# Keep cloud in package names for consistency
s.replace(
"google/**/*.py", "google-monitoring-dashboard", "google-cloud-monitoring-dashboards"
"google/**/*.py", "google-cloud-monitoring-dashboard", "google-cloud-monitoring-dashboards"
)
# ----------------------------------------------------------------------------
# Add templated files
Expand Down

0 comments on commit b2f8ed8

Please sign in to comment.