Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions google/cloud/speech_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@
from .types.cloud_speech import UpdateRecognizerRequest
from .types.cloud_speech import WordInfo

from google.cloud.speech_v1.helpers import SpeechHelpers


class SpeechClient(SpeechHelpers, SpeechClient):
__doc__ = SpeechClient.__doc__


__all__ = (
"SpeechAsyncClient",
"AutoDetectDecodingConfig",
Expand Down
15 changes: 8 additions & 7 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,29 @@
default_version = "v1"

for library in s.get_staging_dirs(default_version):
# Add the manually written SpeechHelpers to v1 and v1p1beta1
# See google/cloud/speech_v1/helpers.py for details
count = s.replace(library / f"google/cloud/speech_{library.name}/__init__.py",
"""__all__ = \(""",
"""from google.cloud.speech_v1.helpers import SpeechHelpers
if "v1" in library.name:
# Add the manually written SpeechHelpers to v1 and v1p1beta1
# See google/cloud/speech_v1/helpers.py for details
count = s.replace(library / f"google/cloud/speech_{library.name}/__init__.py",
"""__all__ = \(""",
"""from google.cloud.speech_v1.helpers import SpeechHelpers

class SpeechClient(SpeechHelpers, SpeechClient):
__doc__ = SpeechClient.__doc__

__all__ = (
""",
)
assert count == 1

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

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

s.remove_staging_dirs()
Expand Down