From af26566e29315178e4d53c892c2c9ce71dc5bd75 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Fri, 1 May 2020 17:11:09 -0700 Subject: [PATCH] chore: Migrate python-containeranalysis synth.py from artman to bazel (#9) --- synth.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/synth.py b/synth.py index 9d1c6d3..b102c0e 100644 --- a/synth.py +++ b/synth.py @@ -20,16 +20,17 @@ logging.basicConfig(level=logging.DEBUG) -gapic = gcp.GAPICGenerator() +gapic = gcp.GAPICBazel() common = gcp.CommonTemplates() # ---------------------------------------------------------------------------- # Generate Container Analysis GAPIC layer # ---------------------------------------------------------------------------- library = gapic.py_library( - "containeranalysis", - "v1", - config_path="/google/devtools/containeranalysis/artman_containeranalysis_v1.yaml", + service="containeranalysis", + version="v1", + bazel_target="//google/devtools/containeranalysis/v1:devtools-containeranalysis-v1-py", + proto_output_path="google/cloud/devtools/containeranalysis_v1/proto", include_protos=True, ) @@ -43,17 +44,12 @@ ] s.move(library, excludes=excludes) -# .proto files end up in the wrong place by default -s.move( - library / "google/cloud/containeranalysis_v1/proto", - "google/cloud/devtools/containeranalysis_v1/proto", -) # Insert helper method to get grafeas client s.replace( "google/**/container_analysis_client.py", r"""_GAPIC_LIBRARY_VERSION = pkg_resources\.get_distribution\( - 'google-cloud-containeranalysis', + 'google-cloud-devtools-containeranalysis', \)\.version""", r"""from grafeas import grafeas_v1 from grafeas.grafeas_v1.gapic.transports import grafeas_grpc_transport