From f0f9878dab7f714a2547f9dc28f2c20dd0ea798f Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Thu, 12 Nov 2020 16:54:59 -0500 Subject: [PATCH 1/2] chore: tweak version lookup for non-admin client Closes #162 Closes #163 --- synth.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/synth.py b/synth.py index 21100c749..8ce6faa76 100644 --- a/synth.py +++ b/synth.py @@ -69,6 +69,23 @@ """ ) +s.replace( + "google/cloud/bigtable_v2/gapic/bigtable_client.py", + """\ +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution\( + 'google-cloud-bigtable', +\).version +""", + """\ +try: + _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-bigtable" + ).version +except pkg_resources.DistributionNotFound: # pragma: NO COVER + _GAPIC_LIBRARY_VERSION = None +""" +) + # ---------------------------------------------------------------------------- # Add templated files # ---------------------------------------------------------------------------- From 2d703efd7cc2776f906a3cf9c5b76b9ba5555a5f Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Mon, 16 Nov 2020 14:50:43 -0500 Subject: [PATCH 2/2] chore: note replacments to be removed w/ move to microgenerator --- synth.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/synth.py b/synth.py index 8ce6faa76..07c293339 100644 --- a/synth.py +++ b/synth.py @@ -45,7 +45,12 @@ s.move(library / "google/cloud/bigtable_admin_v2") s.move(library / "tests") -# Work around non-standard installations +# ---------------------------------------------------------------------------- +# Work around non-standard installations (missing setuptools). +# +# These replacements can be removed after migrating to the microgenerator, +# which will generate them directly. +# ---------------------------------------------------------------------------- admin_clients = [ "google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py",