Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion synth.py
Original file line number Diff line number Diff line change
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(
"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