File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed
packages/google-cloud-python-speech Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 69
69
from .types .cloud_speech import UpdateRecognizerRequest
70
70
from .types .cloud_speech import WordInfo
71
71
72
- from google .cloud .speech_v1 .helpers import SpeechHelpers
73
-
74
-
75
- class SpeechClient (SpeechHelpers , SpeechClient ):
76
- __doc__ = SpeechClient .__doc__
77
-
78
-
79
72
__all__ = (
80
73
"SpeechAsyncClient" ,
81
74
"AutoDetectDecodingConfig" ,
Original file line number Diff line number Diff line change 23
23
default_version = "v1"
24
24
25
25
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
31
32
32
33
class SpeechClient(SpeechHelpers, SpeechClient):
33
34
__doc__ = SpeechClient.__doc__
34
35
35
36
__all__ = (
36
37
""" ,
37
38
)
39
+ assert count == 1
38
40
39
41
if library .name == "v1" :
40
42
# Import from speech_v1 to get the client with SpeechHelpers
41
43
count = s .replace (library / "google/cloud/speech/__init__.py" ,
42
44
"""from google\.cloud\.speech_v1\.services\.speech\.client import SpeechClient""" ,
43
45
"""from google.cloud.speech_v1 import SpeechClient"""
44
46
)
47
+ assert count == 1
45
48
46
- # Don't move over __init__.py, as we modify it to make the generated client
47
- # use helpers.py.
48
49
s .move (library , excludes = ["setup.py" ])
49
50
50
51
s .remove_staging_dirs ()
You can’t perform that action at this time.
0 commit comments