Skip to content

Commit b0760f2

Browse files
authored
Assorted synth fixups / cleanups (googleapis#6400)
* Asset: Replace 'stable' -> 'latest' in docs links, caused by out-of-date synth. * AutoML: fix copying generated docs. * Bigtable: remove now-spurious fixup from 'synth.py'. * DLP: remove now-spurious fixups from 'synth.py'. * Monitoring: remove now-spurious fixups from 'synth.py'. * Redis: remove now-spurious fixups from 'synth.py'. * Speech: remove now-spurious fixups from 'synth.py'.
1 parent d767532 commit b0760f2

File tree

7 files changed

+4
-87
lines changed

7 files changed

+4
-87
lines changed

automl/synth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
library = gapic.py_library('automl', version)
2727
s.move(library / f'google/cloud/automl_{version}')
2828
s.move(library / f'tests/unit/gapic/{version}')
29-
s.move(library / f'docs/gapic/automl/{version}')
29+
s.move(library / f'docs/gapic/{version}')
3030

3131
# Use the highest version library to generate import alias.
3232
s.move(library / 'google/cloud/automl.py')

bigtable/synth.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@
5050
"google/**/*.py",
5151
'from google\.cloud\.bigtable\.admin_v2.proto',
5252
'from google.cloud.bigtable_admin_v2.proto')
53-
s.replace(
54-
"tests/**/*.py",
55-
'from google\.cloud\.bigtable\.admin_v2.proto',
56-
'from google.cloud.bigtable_admin_v2.proto')
5753

5854
s.replace(
5955
['google/cloud/bigtable_admin_v2/gapic/transports/'

dlp/synth.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141
"google\.cloud\.privacy\.dlp_v2",
4242
"google.cloud.dlp_v2"
4343
)
44-
s.replace(
45-
"tests/**/*.py",
46-
"google\.cloud\.privacy\.dlp_v2",
47-
"google.cloud.dlp_v2"
48-
)
4944

5045
# Add missing utf-8 marker
5146
s.replace(
@@ -82,15 +77,6 @@
8277
"\g<1> \\\n\g<2> \\\n"
8378
)
8479

85-
s.replace(
86-
"google/cloud/dlp_v2/proto/storage_pb2.py",
87-
"(proximity:)\n(\s+Proximity.*)\n(\s+reside..*)\n(\s+characters..*)\n"
88-
"(\s+the window.*)\n(\s+of the finding.*)\n(\s+number regex.*)\n"
89-
"(\s+latex:.*)\n(\s+known to be the local.*)\n(\s+hotword regex.*)\n",
90-
"\g<1> \\\n\g<2> \\\n\g<3> \\\n\g<4> \\\n\g<5> \\\n\g<6> \\\n\g<7> "
91-
"\\\n\g<8> \\\n\g<9> \\\n\g<10> \\\n"
92-
)
93-
9480
s.replace(
9581
"google/cloud/dlp_v2/proto/storage_pb2.py",
9682
"(likelihood_adjustment:)\n",

monitoring/synth.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@
3737
]
3838
s.copy(v3_library, excludes=excludes)
3939

40-
# Correct calls to routing_header
41-
# https://github.com/googleapis/gapic-generator/issues/2016
42-
s.replace(
43-
"google/cloud/*/gapic/*_client.py",
44-
"routing_header\(",
45-
"routing_header.to_grpc_metadata(")
46-
4740
# metadata in tests in none but should be empty list.
4841
# https://github.com/googleapis/gapic-generator/issues/2014
4942
s.replace(
@@ -54,19 +47,6 @@
5447
' metadata = []\n'
5548
' metadata = list(metadata)\n')
5649

57-
58-
# empty objects trying to get attrs
59-
# https://github.com/googleapis/gapic-generator/issues/2015
60-
s.replace(
61-
"google/cloud/*/gapic/*_client.py",
62-
"(^ )(routing_header = google.api_core.gapic_v1.routing_header"
63-
".to_grpc_metadata\(\n)"
64-
"(\s+)(\[\('[a-z\_]*?\.name', )([a-z\_]*?)(.name\)\], \)\n)"
65-
"(\s+metadata.append\(routing_header\)\n)",
66-
"\g<1>if hasattr(\g<5>, 'name'):\n"
67-
"\g<1> \g<2>\g<3> \g<4>\g<5>\g<6> \g<7>"
68-
)
69-
7050
# Issues exist where python files should defined the source encoding
7151
# https://github.com/googleapis/gapic-generator/issues/2097
7252
files = ['google/cloud/monitoring_v3/proto/common_pb2.py']

redis/synth.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -92,34 +92,3 @@
9292

9393
r"""
9494
fields from ``Instance``: ``displayName``, ``labels``, ``memorySizeGb``, and ``redisConfig``.""",)
95-
96-
# Set Release Status
97-
release_status = 'Development Status :: 3 - Alpha'
98-
s.replace('setup.py',
99-
'(release_status = )(.*)$',
100-
f"\\1'{release_status}'")
101-
102-
# Fix the enable API link
103-
s.replace(
104-
'README.rst',
105-
r'.. _Enable the Google Cloud Memorystore for Redis API.: https://cloud.google.com/redis',
106-
'.. _Enable the Google Cloud Memorystore for Redis API.: https://console.cloud.google.com/apis/'
107-
'library/redis.googleapis.com')
108-
109-
# Fix link to product page
110-
s.replace(
111-
'README.rst',
112-
r'https://cloud.google.com/redis',
113-
'https://cloud.google.com/memorystore/')
114-
115-
# Fix link to Client Library Documentation
116-
s.replace(
117-
'README.rst',
118-
r'https://googlecloudplatform.github.io/google-cloud-python/stable/redis/usage.html',
119-
'https://googlecloudplatform.github.io/google-cloud-python/latest/redis/index.html')
120-
121-
# Fix link to Auth instructions
122-
s.replace(
123-
'README.rst',
124-
r'https://googlecloudplatform.github.io/google-cloud-python/stable/core/auth.html',
125-
'https://googlecloudplatform.github.io/google-cloud-python/latest/core/auth.html')

securitycenter/README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Python Client for Cloud Security Command Center API (`Alpha`_)
1515
:target: https://pypi.org/project/google-cloud-securitycenter/
1616
.. _Alpha: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst
1717
.. _Cloud Security Command Center API: https://cloud.google.com/security-command-center
18-
.. _Client Library Documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/securitycenter/usage.html
18+
.. _Client Library Documentation: https://googlecloudplatform.github.io/google-cloud-python/latest/securitycenter/usage.html
1919
.. _Product Documentation: https://cloud.google.com/security-command-center
2020

2121

@@ -32,7 +32,7 @@ In order to use this library, you first need to go through the following steps:
3232
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
3333
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
3434
.. _Enable the Cloud Security Command Center API.: https://cloud.google.com/security-command-center
35-
.. _Setup Authentication.: https://googlecloudplatform.github.io/google-cloud-python/stable/core/auth.html
35+
.. _Setup Authentication.: https://googlecloudplatform.github.io/google-cloud-python/latest/core/auth.html
3636

3737
Installation
3838
~~~~~~~~~~~~
@@ -80,4 +80,4 @@ Next Steps
8080
APIs that we cover.
8181

8282
.. _Cloud Security Command Center API Product documentation: https://cloud.google.com/security-command-center
83-
.. _repository’s main README: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst
83+
.. _repository’s main README: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst

speech/synth.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,6 @@
4040
s.move(library / 'google/cloud/speech.py')
4141

4242

43-
# Fix bad reference to operations_v1
44-
s.replace(
45-
'**/gapic/**/*_transport.py',
46-
r' \= operations_v1\.',
47-
' = google.api_core.operations_v1.')
48-
49-
50-
# Fix bad docstrings.
51-
s.replace(
52-
'**/gapic/*_client.py',
53-
r'\\"(.+?)-\*\\"',
54-
r'"\1-\\*"')
55-
56-
5743
# Issues exist where python files should define the source encoding
5844
# https://github.com/googleapis/gapic-generator/issues/2097
5945
s.replace(

0 commit comments

Comments
 (0)