Skip to content

Commit

Permalink
fix(tts,stt,version): unpinned websocket-client
Browse files Browse the repository at this point in the history
fixes #810 and adds support for up to latest websocket-client (1.6.1)
  • Loading branch information
arne-kapell authored and apaparazzi0329 committed Aug 7, 2023
1 parent c08a117 commit 75432a6
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ibm_watson/websocket/recognize_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def on_error(self, ws, error):
"""
self.callback.on_error(error)

def on_close(self, ws):
def on_close(self, ws, *args):
"""
Callback executed when websocket connection is closed
Expand Down
2 changes: 1 addition & 1 deletion ibm_watson/websocket/synthesize_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def on_error(self, ws, error):
"""
self.callback.on_error(error)

def on_close(self, ws, **kwargs):
def on_close(self, ws, *args, **kwargs):
"""
Callback executed when websocket connection is closed
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Sphinx==3.5.2
bumpversion==0.6.0

# Web sockets
websocket-client==1.1.0
websocket-client>=1.1.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
requests>=2.0,<3.0
python_dateutil>=2.5.3
websocket-client==1.1.0
websocket-client>=1.1.0
ibm_cloud_sdk_core>=3.3.6, == 3.*
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
version=__version__,
description='Client library to use the IBM Watson Services',
packages=['ibm_watson'],
install_requires=['requests>=2.0, <3.0', 'python_dateutil>=2.5.3', 'websocket-client==1.1.0', 'ibm_cloud_sdk_core>=3.3.6, == 3.*'],
install_requires=['requests>=2.0, <3.0', 'python_dateutil>=2.5.3', 'websocket-client>=1.1.0', 'ibm_cloud_sdk_core>=3.3.6, == 3.*'],
tests_require=['responses', 'pytest', 'python_dotenv', 'pytest-rerunfailures'],
license='Apache 2.0',
author='IBM Watson',
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_speech_to_text_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def on_transcription(self, transcript):
interim_results=False, low_latency=False)
assert test_callback.error is None
assert test_callback.transcript is not None
assert test_callback.transcript[0][0]['transcript'] == 'isolated tornadoes '
assert test_callback.transcript[0][0]['transcript'] in ['isolated tornadoes ', 'isolated tornados ']
assert test_callback.transcript[1][0]['transcript'] == 'and heavy rain '

def test_on_transcription_interim_results_true(self):
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_text_to_speech_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def on_close(self):
'She sells seashells by the seashore',
test_callback,
accept='audio/wav',
voice='en-AU_CraigVoice')
voice='en-GB_JamesV3Voice')
assert test_callback.error is None
assert test_callback.fd is not None
assert os.stat(file).st_size > 0
Expand Down

0 comments on commit 75432a6

Please sign in to comment.