Skip to content

Commit ca02b93

Browse files
update
1 parent 7f73918 commit ca02b93

File tree

10 files changed

+70
-57
lines changed

10 files changed

+70
-57
lines changed

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ ensure-deps: #### Ensure that all required dependency utilities are downloaded o
4343

4444
GO_MODULES=$(shell find . -path "*/go.mod" | xargs -I _ dirname _)
4545

46-
# pystatic: #### Performs Python static analysis
47-
# pylint --rcfile .pylintrc deepgram
48-
4946
PYTHON_FILES=.
5047
lint_files: PYTHON_FILES=deepgram/ examples/
5148
lint_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d main | grep -E '\.py$$')
@@ -56,7 +53,7 @@ lint_files lint_diff: #### Performs Python formatting
5653
black blackformat format: lint_files
5754

5855
pylint: lint_files #### Performs Python linting
59-
pylint --rcfile .pylintrc deepgram
56+
pylint --disable=W0622 --disable=W0404 --disable=W0611 --rcfile .pylintrc deepgram
6057

6158
lint: pylint #### Performs Golang programming lint
6259

deepgram/__init__.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,27 @@
3838
UrlSource,
3939
Sentiment,
4040
)
41+
from .client import (
42+
OpenResponse,
43+
MetadataResponse,
44+
CloseResponse,
45+
UnhandledResponse,
46+
ErrorResponse,
47+
)
4148

4249
# live
4350
from .client import LiveTranscriptionEvents
4451
from .client import LiveClient, AsyncLiveClient
4552
from .client import LiveOptions
4653
from .client import (
47-
OpenResponse,
54+
# OpenResponse,
4855
LiveResultResponse,
49-
MetadataResponse,
56+
# MetadataResponse,
5057
SpeechStartedResponse,
5158
UtteranceEndResponse,
52-
CloseResponse,
53-
UnhandledResponse,
54-
ErrorResponse,
59+
# CloseResponse,
60+
# UnhandledResponse,
61+
# ErrorResponse,
5562
)
5663

5764
# prerecorded
@@ -84,7 +91,7 @@
8491
# speak
8592
from .client import (
8693
SpeakOptions,
87-
FileSource,
94+
# FileSource,
8895
SpeakWebSocketSource,
8996
SpeakSource,
9097
)
@@ -109,13 +116,13 @@
109116
)
110117
from .client import (
111118
SpeakWebSocketResponse,
112-
OpenResponse,
113-
MetadataResponse,
119+
# OpenResponse,
120+
# MetadataResponse,
114121
FlushedResponse,
115-
CloseResponse,
116-
UnhandledResponse,
122+
# CloseResponse,
123+
# UnhandledResponse,
117124
WarningResponse,
118-
ErrorResponse,
125+
# ErrorResponse,
119126
)
120127

121128
# manage

deepgram/client.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
from typing import Optional
66
from importlib import import_module
77
import os
8-
9-
import deprecation
8+
import logging
9+
import deprecation # type: ignore
1010

1111
from . import __version__
12-
import logging
1312
from .utils import verboselogs
1413

1514
# common
@@ -22,6 +21,13 @@
2221
UrlSource,
2322
Sentiment,
2423
)
24+
from .clients import (
25+
OpenResponse,
26+
MetadataResponse,
27+
CloseResponse,
28+
UnhandledResponse,
29+
ErrorResponse,
30+
)
2531

2632
# listen client
2733
from .clients import Listen, Read, Speak
@@ -35,14 +41,14 @@
3541

3642
# live client responses
3743
from .clients import (
38-
OpenResponse,
44+
# OpenResponse,
3945
LiveResultResponse,
40-
MetadataResponse,
46+
# MetadataResponse,
4147
SpeechStartedResponse,
4248
UtteranceEndResponse,
43-
CloseResponse,
44-
ErrorResponse,
45-
UnhandledResponse,
49+
# CloseResponse,
50+
# ErrorResponse,
51+
# UnhandledResponse,
4652
)
4753

4854
# prerecorded
@@ -82,7 +88,7 @@
8288
# speak
8389
from .clients import (
8490
SpeakOptions,
85-
FileSource,
91+
# FileSource,
8692
SpeakWebSocketSource,
8793
SpeakSource,
8894
)
@@ -107,13 +113,13 @@
107113
)
108114
from .clients import (
109115
SpeakWebSocketResponse,
110-
OpenResponse,
111-
MetadataResponse,
116+
# OpenResponse,
117+
# MetadataResponse,
112118
FlushedResponse,
113-
CloseResponse,
114-
UnhandledResponse,
119+
# CloseResponse,
120+
# UnhandledResponse,
115121
WarningResponse,
116-
ErrorResponse,
122+
# ErrorResponse,
117123
)
118124

119125
# manage client classes/input

deepgram/clients/__init__.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
UrlSource,
1212
Sentiment,
1313
)
14+
from .listen import (
15+
OpenResponse,
16+
MetadataResponse,
17+
CloseResponse,
18+
UnhandledResponse,
19+
ErrorResponse,
20+
)
1421

1522
from .listen_router import Listen
1623
from .read_router import Read
@@ -34,8 +41,8 @@
3441
from .listen import (
3542
PrerecordedOptions,
3643
PreRecordedStreamSource,
37-
UrlSource,
38-
FileSource,
44+
# UrlSource,
45+
# FileSource,
3946
PrerecordedSource,
4047
)
4148

@@ -55,14 +62,14 @@
5562

5663
## output
5764
from .listen import (
58-
OpenResponse,
65+
# OpenResponse,
5966
LiveResultResponse,
60-
MetadataResponse,
67+
# MetadataResponse,
6168
SpeechStartedResponse,
6269
UtteranceEndResponse,
63-
CloseResponse,
64-
ErrorResponse,
65-
UnhandledResponse,
70+
# CloseResponse,
71+
# ErrorResponse,
72+
# UnhandledResponse,
6673
)
6774

6875
## clients
@@ -90,7 +97,7 @@
9097
## common
9198
from .speak import (
9299
SpeakOptions,
93-
FileSource,
100+
# FileSource,
94101
SpeakWebSocketSource,
95102
SpeakSource,
96103
)
@@ -116,13 +123,13 @@
116123
)
117124
from .speak import (
118125
SpeakWebSocketResponse,
119-
OpenResponse,
120-
MetadataResponse,
126+
# OpenResponse,
127+
# MetadataResponse,
121128
FlushedResponse,
122-
CloseResponse,
123-
UnhandledResponse,
129+
# CloseResponse,
130+
# UnhandledResponse,
124131
WarningResponse,
125-
ErrorResponse,
132+
# ErrorResponse,
126133
)
127134

128135
# manage

deepgram/clients/listen/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: MIT
44

55

6-
from ...options import DeepgramClientOptions, ClientOptionsFromEnv
6+
# from ...options import DeepgramClientOptions, ClientOptionsFromEnv
77

88
# rest
99
from .v1 import (

deepgram/clients/listen_router.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
from importlib import import_module
66
import logging
7-
8-
import deprecation
7+
import deprecation # type: ignore
98

109
from .. import __version__
1110
from .listen.v1 import (

deepgram/clients/speak/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
SpeakWebSocketResponse as SpeakWebSocketResponseLatest,
2020
OpenResponse as OpenResponseLatest,
2121
MetadataResponse as MetadataResponseLatest,
22-
FlushedResponse as MetadataResponseLatest,
22+
FlushedResponse as FlushedResponseLatest,
2323
CloseResponse as CloseResponseLatest,
2424
UnhandledResponse as UnhandledResponseLatest,
2525
WarningResponse as WarningResponseLatest,
@@ -41,7 +41,7 @@
4141
SpeakWebSocketResponse = SpeakWebSocketResponseLatest
4242
OpenResponse = OpenResponseLatest
4343
MetadataResponse = MetadataResponseLatest
44-
FlushedResponse = MetadataResponseLatest
44+
FlushedResponse = FlushedResponseLatest
4545
CloseResponse = CloseResponseLatest
4646
UnhandledResponse = UnhandledResponseLatest
4747
WarningResponse = WarningResponseLatest

deepgram/clients/speak/v1/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@
55
from .options import SpeakOptions, FileSource, SpeakWebSocketSource, SpeakSource
66
from ....options import DeepgramClientOptions, ClientOptionsFromEnv
77

8-
# backward compatibility
9-
from .rest import (
10-
SpeakRESTClient as SpeakClient,
11-
AsyncSpeakRESTClient as AsyncSpeakClient,
12-
)
13-
from .rest import SpeakRESTResponse as SpeakResponse
14-
158
# rest
169
from .rest import SpeakRESTClient, AsyncSpeakRESTClient
10+
1711
from .rest import SpeakRESTResponse
1812

1913
# websocket

deepgram/clients/speak_router.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
from importlib import import_module
66
import logging
7-
8-
import deprecation
7+
import deprecation # type: ignore
98

109
from .. import __version__
1110
from .speak.v1.rest.client import SpeakRESTClient
@@ -38,6 +37,8 @@ def __init__(self, config: DeepgramClientOptions):
3837
self._logger.setLevel(config.verbose)
3938
self._config = config
4039

40+
# when this is removed, remove --disable=W0622 from Makefile
41+
# pylint: disable=unused-argument
4142
@deprecation.deprecated(
4243
deprecated_in="3.4.0",
4344
removed_in="4.0.0",
@@ -50,6 +51,8 @@ def v(self, version: str = ""):
5051
"""
5152
return SpeakRESTClient(self._config)
5253

54+
# pylint: enable=unused-argument
55+
5356
@property
5457
def rest(self):
5558
"""

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ ignore_missing_imports = True
2323
ignore_missing_imports = True
2424

2525
[mypy-aenum]
26-
ignore_missing_imports = True
26+
ignore_missing_imports = True

0 commit comments

Comments
 (0)