From c34952e0da5dd046c3709fc0fb92e1a60e419d1c Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Fri, 8 May 2020 16:17:04 -0700 Subject: [PATCH] chore: Migrate python-translate synth.py from artman to bazel (#10) --- packages/google-cloud-translate/synth.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index f37eb503eef2..eb8a48fc42bb 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -17,7 +17,7 @@ import synthtool as s from synthtool import gcp -gapic = gcp.GAPICGenerator() +gapic = gcp.GAPICBazel() common = gcp.CommonTemplates() versions = ["v3beta1", "v3"] @@ -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) @@ -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")