Skip to content

Commit 9ef71a1

Browse files
nitsanshaiNitsan Shaiparthea
authored
fix: remove SpeechHelpers from STT V2 client library (#452)
* fix: remove SpeechHelpers from STT V2 client library * chore: update post processing script * chore: clean up post processing script Co-authored-by: Nitsan Shai <nshai@google.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent e70f7c7 commit 9ef71a1

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

packages/google-cloud-python-speech/google/cloud/speech_v2/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,6 @@
6969
from .types.cloud_speech import UpdateRecognizerRequest
7070
from .types.cloud_speech import WordInfo
7171

72-
from google.cloud.speech_v1.helpers import SpeechHelpers
73-
74-
75-
class SpeechClient(SpeechHelpers, SpeechClient):
76-
__doc__ = SpeechClient.__doc__
77-
78-
7972
__all__ = (
8073
"SpeechAsyncClient",
8174
"AutoDetectDecodingConfig",

packages/google-cloud-python-speech/owlbot.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,29 @@
2323
default_version = "v1"
2424

2525
for library in s.get_staging_dirs(default_version):
26-
# Add the manually written SpeechHelpers to v1 and v1p1beta1
27-
# See google/cloud/speech_v1/helpers.py for details
28-
count = s.replace(library / f"google/cloud/speech_{library.name}/__init__.py",
29-
"""__all__ = \(""",
30-
"""from google.cloud.speech_v1.helpers import SpeechHelpers
26+
if "v1" in library.name:
27+
# Add the manually written SpeechHelpers to v1 and v1p1beta1
28+
# See google/cloud/speech_v1/helpers.py for details
29+
count = s.replace(library / f"google/cloud/speech_{library.name}/__init__.py",
30+
"""__all__ = \(""",
31+
"""from google.cloud.speech_v1.helpers import SpeechHelpers
3132
3233
class SpeechClient(SpeechHelpers, SpeechClient):
3334
__doc__ = SpeechClient.__doc__
3435
3536
__all__ = (
3637
""",
3738
)
39+
assert count == 1
3840

3941
if library.name == "v1":
4042
# Import from speech_v1 to get the client with SpeechHelpers
4143
count = s.replace(library / "google/cloud/speech/__init__.py",
4244
"""from google\.cloud\.speech_v1\.services\.speech\.client import SpeechClient""",
4345
"""from google.cloud.speech_v1 import SpeechClient"""
4446
)
47+
assert count == 1
4548

46-
# Don't move over __init__.py, as we modify it to make the generated client
47-
# use helpers.py.
4849
s.move(library, excludes=["setup.py"])
4950

5051
s.remove_staging_dirs()

0 commit comments

Comments
 (0)