Skip to content

Commit

Permalink
Test ovos-core 0.0.8 compat. (#641)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored May 9, 2024
1 parent f86d1c5 commit 7b0a8d5
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 34 deletions.
8 changes: 4 additions & 4 deletions requirements/core_modules.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# neon core modules
neon-messagebus~=2.0,>=2.0.1
neon-enclosure~=1.7
neon-messagebus~=2.0,>=2.0.2a6
neon-enclosure~=1.7,>=1.7.1a1
neon-speech~=4.4,>=4.4.1
neon-gui~=1.3
neon-audio~=1.5,>=1.5.1
neon-gui~=1.3,>=1.3.1a1
neon-audio~=1.5,>=1.5.2a5
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
neon-cli-client~=0.2
neon-mana-utils~=0.2,>=0.2.1
neon-mana-utils~=0.2,>=0.2.3a2
neon-minerva~=0.1
2 changes: 1 addition & 1 deletion requirements/local_speech_processing.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
neon-stt-plugin-deepspeech-stream-local~=2.0
neon-stt-plugin-nemo~=0.0
neon-tts-plugin-coqui~=0.8
neon-tts-plugin-coqui~=0.8,>=0.8.1a1
onnxruntime!=1.16.0 # TODO: Patching https://github.com/microsoft/onnxruntime/issues/17631
# TODO: Local language plugin

Expand Down
9 changes: 4 additions & 5 deletions requirements/pi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sdnotify~=0.3

# Default debug client
neon-cli-client~=0.3
neon-mana-utils~=0.2,>=0.2.2
neon-mana-utils~=0.2,>=0.2.3a2

# Default plugins
ovos-vad-plugin-silero~=0.0.1
Expand All @@ -22,20 +22,19 @@ ovos-ww-plugin-openwakeword~=0.2
neon-stt-plugin-google-cloud-streaming~=1.0,>=1.0.1

neon-tts-plugin-coqui-remote~=0.0.3
neon-stt-plugin-nemo~=0.0.4
neon-stt-plugin-nemo~=0.0.4,>=0.0.5a2
ovos-tts-plugin-server==0.0.2a12

# Fallback plugins
neon-tts-plugin-coqui~=0.8
neon-tts-plugin-coqui~=0.8,>=0.8.1a1
ovos-stt-plugin-vosk~=0.1,>=0.1.4

# PHAL Plugins
neon-phal-plugin-monitoring~=0.0.2
neon-phal-plugin-audio-receiver~=0.0.4
neon-phal-plugin-reset~=0.4,>=0.4.1
neon-phal-plugin-core-updater~=1.3
neon-phal-plugin-device-updater~=0.2
neon-phal-plugin-fan~=0.1
neon-phal-plugin-fan~=0.1,>=0.1.1a1
neon-phal-plugin-switches~=0.0.5
neon-phal-plugin-linear_led~=0.2,>=0.2.3
neon-phal-plugin-gui-network-client~=0.0.5
Expand Down
27 changes: 13 additions & 14 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# ovos-core version pinned for compat. with patches in NeonCore
ovos-core==0.0.7
ovos-core[mycroft,lgpl]>=0.0.8a95
# padacioso==0.1.3a2

neon-utils[network,audio]~=1.10,>=1.10.2a1
neon-utils[network,audio]~=1.10,>=1.10.2a2
# TODO: audio for alpha resolution
ovos-utils~=0.0,>=0.0.38
ovos-bus-client~=0.0.8
neon-transformers~=0.2
ovos-bus-client~=0.0.8,>=0.0.9a20
neon-transformers~=0.2,>=0.2.1a4
ovos-config~=0.0.12
ovos-plugin-manager~=0.0.25
ovos-plugin-manager~=0.0.25,>=0.0.26a19
# TODO: ovos-backend-client pinned for stable release
ovos-backend-client==0.1.1a5
psutil~=5.6

click~=8.0
Expand All @@ -19,15 +21,12 @@ mock~=5.0

# default plugins
neon-lang-plugin-libretranslate~=0.2
neon-utterance-translator-plugin~=0.2
neon-utterance-translator-plugin~=0.2,>=0.2.1a1
neon-utterance-normalizer-plugin~=0.1

requests~=2.29
# TODO: Below adding support for ovos-utils 0.1.0
#neon-mq-connector>=0.7.2a2

# TODO: Patching dependencies ovos-core[skills,skills_lgpl] extra deps
ovos-backend-client~=0.1,>=0.1.1a2
adapt-parser~=0.5
padacioso~=0.1
ovos-phal-plugin-connectivity-events~=0.0.1
padatious~=0.4.8
fann2==1.0.7
## TODO: Below supporting resolution of ovos-utils<0.1.0
ovos-plugin-common-play==0.0.6
ovos-utils~=0.0.38
36 changes: 27 additions & 9 deletions test/test_skills_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,25 @@ def test_neon_skills_service(self, run):
# from mycroft.util.process_utils import ProcessState

config = {"skills": {
"disable_osm": False,
"auto_update": True,
"directory": join(dirname(__file__), "skill_module_skills"),
"run_gui_file_server": True
}
"disable_osm": False,
"auto_update": True,
"directory": join(dirname(__file__), "skill_module_skills"),
"run_gui_file_server": True
},
"location": {"timezone": {"code": "America/Los_Angeles",
"name": "Pacific Standard Time",
"dstOffset": 3600000,
"offset": -28800000},
"coordinate": {"latitude": 47.482880,
"longitude": -122.217064},
"city": {"code": "Renton",
"name": "Renton",
"state": {"code": "WA", "name": "Washington",
"country": {"code": "US",
"name": "United States"}
}
}
},
}

started = Event()
Expand All @@ -109,12 +123,13 @@ def ready_hook():
daemonic=True)
from neon_core.configuration import Configuration
self.assertEqual(service.config, Configuration())
self.assertIsInstance(Configuration()["location"]["timezone"], dict)
self.assertTrue(all(config['skills'][x] == service.config['skills'][x]
for x in config['skills']))
service.bus = FakeBus()
service.bus.connected_event = Event()
service.start()
started.wait(30)
started.wait(60)
self.assertTrue(service.config['skills']['auto_update'])
# install_default.assert_called_once()

Expand Down Expand Up @@ -175,6 +190,10 @@ def setUpClass(cls) -> None:
os.environ["OVOS_CONFIG_BASE_FOLDER"] = "neon"
os.environ["OVOS_CONFIG_FILENAME"] = "neon.yaml"
use_neon_core(init_config_dir)()
import ovos_config
import importlib
importlib.reload(ovos_config.config)
importlib.reload(ovos_config)

from neon_core.skills.intent_service import NeonIntentService
cls.intent_service = NeonIntentService(cls.bus)
Expand All @@ -195,7 +214,7 @@ def test_save_utterance_transcription(self):
"lang": "en-us"},
{"timing": {"transcribed": transcribe_time}})
self.intent_service._save_utterance_transcription(test_message)
self.intent_service.transcript_service.write_transcript.\
self.intent_service.transcript_service.write_transcript. \
assert_called_once_with(None, test_message.data["utterances"][0],
transcribe_time, None)

Expand Down Expand Up @@ -247,11 +266,10 @@ def mod_2_parse(utterances, lang):

valid_parsers = {"cancel", "entity_parser", "translator"}
self.assertTrue(all([p for p in valid_parsers if p in
self.intent_service.transformers.loaded_modules]))
self.intent_service.transformers.loaded_modules]))

@patch("mycroft.skills.intent_service.IntentService.handle_utterance")
def test_handle_utterance(self, patched):

test_message_invalid = Message("test", {"utterances": [' ', ' ']})
self.intent_service.handle_utterance(test_message_invalid)
patched.assert_not_called()
Expand Down

0 comments on commit 7b0a8d5

Please sign in to comment.