Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
chore: Migrate python-translate synth.py from artman to bazel (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
vam-google committed May 8, 2020
1 parent dfbcd7f commit 0eb9ad1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import synthtool as s
from synthtool import gcp

gapic = gcp.GAPICGenerator()
gapic = gcp.GAPICBazel()
common = gcp.CommonTemplates()
versions = ["v3beta1", "v3"]

Expand All @@ -34,7 +34,12 @@
# Generate asset GAPIC layer
# ----------------------------------------------------------------------------
for version in versions:
library = gapic.py_library("translate", version, include_protos=True)
library = gapic.py_library(
service="translate",
version=version,
bazel_target=f"//google/cloud/translate/{version}:translation-{version}-py",
include_protos=True,
)

# s.move(library / f'google/cloud/translation_{version}', f'google/cloud/translate_{version}', excludes=excludes)
s.move(library / f"google/cloud/translate_{version}", excludes=excludes)
Expand All @@ -47,6 +52,11 @@
f"google.cloud.translation_{version}.proto",
f"google.cloud.translate_{version}.proto",
)
s.replace(
f"google/cloud/translate_{version}/gapic/translation_service_client.py",
"google-cloud-translation",
"google-cloud-translate",
)

# Use the highest version library to generate documentation import alias.
s.move(library / "google/cloud/translate.py")
Expand Down

0 comments on commit 0eb9ad1

Please sign in to comment.