diff --git a/neon_speech/service.py b/neon_speech/service.py index bf84cd8..0644813 100644 --- a/neon_speech/service.py +++ b/neon_speech/service.py @@ -129,8 +129,7 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error, self.lock = Lock() self._stop_service = Event() if self.config.get('listener', {}).get('enable_stt_api', True): - self.api_stt = STTFactory.create(config=self.config, - results_event=None) + self.api_stt = STTFactory.create(config=self.config) else: LOG.info("Skipping api_stt init") self.api_stt = None diff --git a/neon_speech/utils.py b/neon_speech/utils.py index 6821a42..7369308 100644 --- a/neon_speech/utils.py +++ b/neon_speech/utils.py @@ -104,6 +104,7 @@ def init_stt_plugin(plugin: str): LOG.warning(f"Could not find plugin: {plugin}") +@deprecated("Platform detection has been deprecated", "5.0.0") def use_neon_speech(func): """ Wrapper to ensure call originates from neon_speech for stack checks. diff --git a/requirements/docker.txt b/requirements/docker.txt index bb0aae8..6831c38 100644 --- a/requirements/docker.txt +++ b/requirements/docker.txt @@ -1,5 +1,5 @@ ovos-stt-plugin-vosk~=0.1 -neon-stt-plugin-nemo~=0.0.2 +neon-stt-plugin-nemo~=0.0.2,>=0.0.5a4 onnxruntime!=1.16.0 # TODO: Patching https://github.com/microsoft/onnxruntime/issues/17631 # Load alternative WW plugins so they are available diff --git a/tests/unit_tests.py b/tests/unit_tests.py index 3845018..b2ed9e3 100644 --- a/tests/unit_tests.py +++ b/tests/unit_tests.py @@ -34,7 +34,8 @@ from os.path import dirname, join from threading import Thread, Event -from unittest.mock import Mock, patch +from unittest import skip +from unittest.mock import patch from click.testing import CliRunner from ovos_bus_client import Message @@ -44,6 +45,8 @@ CONFIG_PATH = os.path.join(dirname(__file__), "config") os.environ["XDG_CONFIG_HOME"] = CONFIG_PATH +os.environ["OVOS_CONFIG_BASE_FOLDER"] = "neon" +os.environ["OVOS_CONFIG_FILENAME"] = "neon.yaml" sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) @@ -80,12 +83,13 @@ def test_install_stt_plugin(self): "ovos-stt-plugin-vosk")) import ovos_stt_plugin_vosk + @skip("Configuration patching is deprecated") def test_patch_config(self): from neon_speech.utils import use_neon_speech from neon_utils.configuration_utils import init_config_dir test_config_dir = os.path.join(os.path.dirname(__file__), "config") os.makedirs(test_config_dir, exist_ok=True) - os.environ["XDG_CONFIG_HOME"] = test_config_dir + use_neon_speech(init_config_dir)() with open(join(test_config_dir, "OpenVoiceOS", 'ovos.conf')) as f: @@ -156,7 +160,7 @@ def test_ovos_plugin_compat(self): ovos_vosk_streaming = STTFactory().create( {'module': 'ovos-stt-plugin-vosk-streaming', 'lang': 'en-us'}) - self.assertIsInstance(ovos_vosk_streaming.results_event, Event) + # self.assertIsInstance(ovos_vosk_streaming.results_event, Event) test_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), "audio_files", "stop.wav") from neon_utils.file_utils import get_audio_file_stream