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: clean up synth replacements #161

Merged
merged 1 commit into from Nov 11, 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
50 changes: 19 additions & 31 deletions synth.py
Expand Up @@ -45,40 +45,28 @@
s.move(library / "google/cloud/bigtable_admin_v2")
s.move(library / "tests")

s.replace(
[
"google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py",
"google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py",
],
"'google-cloud-bigtable-admin'",
"'google-cloud-bigtable'",
)

s.replace(
"google/**/*.py",
"from google\.cloud\.bigtable\.admin_v2.proto",
"from google.cloud.bigtable_admin_v2.proto",
)
# Work around non-standard installations

s.replace(
["google/cloud/bigtable_admin_v2/__init__.py"],
" __doc__ = bigtable_instance_admin_client."
"BigtableInstanceAdminClient.__doc__\n",
" __doc__ = (\n"
" bigtable_instance_admin_client.BigtableInstanceAdminClient."
"__doc__)\n",
)

s.replace(
["google/cloud/bigtable_v2/gapic/bigtable_client.py"],
"if ``true_mutations`` is empty, and at most\n\n\s*100000.",
"if ``true_mutations`` is empty, and at most 100000.",
)
admin_clients = [
"google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py",
"google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py",
]

s.replace(
["google/cloud/bigtable_v2/gapic/bigtable_client.py"],
"if ``false_mutations`` is empty, and at most\n\n\s*100000.",
"if ``false_mutations`` is empty, and at most 100000.",
admin_clients,
"""\
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution\(
'google-cloud-bigtable-admin',
\).version
""",
"""\
try:
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution(
"google-cloud-bigtable"
).version
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GAPIC_LIBRARY_VERSION = None
"""
)

# ----------------------------------------------------------------------------
Expand Down