Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: tweak version lookup for non-admin client #165

Merged
merged 2 commits into from Nov 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 23 additions & 1 deletion synth.py
Expand Up @@ -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",
Expand All @@ -69,6 +74,23 @@
"""
)

s.replace(
tseaver marked this conversation as resolved.
Show resolved Hide resolved
"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
# ----------------------------------------------------------------------------
Expand Down