Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor for compat. with latest ovos releases #600

Merged
merged 16 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions neon_core/skills/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import ovos_workshop.skills
ovos_workshop.skills.mycroft_skill.MycroftSkill = PatchedMycroftSkill

# TODO: Patch OVOS Skill?
workshop_modules = ("ovos_workshop.skills.ovos",
"ovos_workshop.skills.fallback",
"ovos_workshop.skills.common_query_skill",
Expand Down
3 changes: 1 addition & 2 deletions neon_core/skills/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@
from neon_utils.signal_utils import init_signal_handlers, init_signal_bus
from neon_utils.messagebus_utils import get_messagebus
from ovos_bus_client.util.scheduler import EventScheduler
from ovos_utils.skills.api import SkillApi
from ovos_workshop.skills.api import SkillApi
from ovos_workshop.skills.fallback import FallbackSkill

from neon_core.skills.intent_service import NeonIntentService
from neon_core.skills.skill_manager import NeonSkillManager
from neon_core.util.diagnostic_utils import report_metric


def on_started():
Expand Down
4 changes: 2 additions & 2 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.1a1
neon_enclosure~=1.6,>=1.6.1
neon_enclosure~=1.6,>=1.6.2a1
neon_speech~=4.3
neon_gui~=1.2,>=1.2.2
neon_audio~=1.5
neon_audio~=1.5,>=1.5.1a1
2 changes: 1 addition & 1 deletion requirements/pi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ovos-phal-plugin-balena-wifi~=1.0.0
neon-phal-plugin-gui-network-client~=0.0.3
ovos-phal-plugin-network-manager~=1.1
ovos-phal-plugin-wifi-setup~=1.1,>=1.1.1
ovos-phal-plugin-oauth~=0.0.2
ovos-phal-plugin-oauth~=0.0.2,>=0.0.3a1
ovos-phal-plugin-alsa~=0.0.3
ovos-phal-plugin-system~=0.0.4
ovos-phal-plugin-connectivity-events~=0.0.3
Expand Down
10 changes: 5 additions & 5 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# ovos-core version pinned for compat. with patches in NeonCore
ovos-core==0.0.7
# padacioso==0.1.3a2
ovos-plugin-common-play~=0.0.5
ovos-plugin-common-play~=0.0.5,>=0.0.6a13

neon-utils[network]~=1.8,>=1.8.2
# TODO: Audio for alpha resolution
neon-utils[network,audio]~=1.8,>=1.8.3a2

ovos-utils~=0.0.37
ovos-utils~=0.0.38
ovos-bus-client~=0.0.8
neon-transformers~=0.2
ovos-config~=0.0.12
ovos-plugin-manager~=0.0.25
# Testing latest OPM
ovos-backend-client~=0.0.6
ovos-backend-client~=0.1,>=0.1.1a2
psutil~=5.6

click~=8.0
Expand Down
33 changes: 17 additions & 16 deletions test/test_skill_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,45 +202,46 @@ def test_skill_class_patches(self):
self.assertEqual(FallbackSkill1, FallbackSkill)
self.assertEqual(FallbackSkill2, FallbackSkill)

self.assertTrue(issubclass(FallbackSkill, PatchedMycroftSkill))
from neon_utils.skills.neon_skill import NeonSkill
# self.assertTrue(issubclass(FallbackSkill, NeonSkill))
self.assertTrue(issubclass(CommonPlaySkill, PatchedMycroftSkill))
self.assertTrue(issubclass(CommonQuerySkill, PatchedMycroftSkill))
self.assertTrue(issubclass(CommonIoTSkill, PatchedMycroftSkill))

from ovos_workshop.skills.mycroft_skill import MycroftSkill as Patched
from ovos_workshop.skills import MycroftSkill as Patched2
from ovos_workshop.skills.ovos import MycroftSkill as Patched3
# from ovos_workshop.skills.ovos import MycroftSkill as Patched3
self.assertEqual(Patched, PatchedMycroftSkill)
self.assertEqual(Patched2, PatchedMycroftSkill)
self.assertEqual(Patched3, PatchedMycroftSkill)
# self.assertEqual(Patched3, PatchedMycroftSkill)

from ovos_workshop.skills.ovos import OVOSSkill
from ovos_workshop.skills import OVOSSkill as OVOSSkill2
self.assertTrue(issubclass(OVOSSkill, PatchedMycroftSkill))
# self.assertTrue(issubclass(OVOSSkill, PatchedMycroftSkill))
self.assertEqual(OVOSSkill, OVOSSkill2)

from neon_utils.skills import NeonFallbackSkill, NeonSkill
self.assertTrue(issubclass(NeonFallbackSkill, PatchedMycroftSkill))
# self.assertTrue(issubclass(NeonFallbackSkill, PatchedMycroftSkill))
# self.assertTrue(issubclass(NeonSkill, PatchedMycroftSkill))
self.assertTrue(issubclass(NeonFallbackSkill, OVOSSkill))
self.assertTrue(issubclass(NeonFallbackSkill, NeonSkill))
# self.assertTrue(issubclass(NeonFallbackSkill, NeonSkill))

from neon_utils.skills.neon_fallback_skill import NeonFallbackSkill as \
NeonFallbackSkill2
from neon_utils.skills.neon_skill import NeonSkill as NeonSkill2
self.assertEqual(NeonFallbackSkill, NeonFallbackSkill2)
self.assertEqual(NeonSkill, NeonSkill2)

from ovos_workshop.skills.common_play import OVOSCommonPlaybackSkill
self.assertTrue(issubclass(OVOSCommonPlaybackSkill,
PatchedMycroftSkill))

try:
from ovos_workshop.skills.common_query_skill import CommonQuerySkill
self.assertTrue(issubclass(CommonQuerySkill, PatchedMycroftSkill))
except ModuleNotFoundError:
# Class added in ovos-workwhop 0.0.12
pass
# from ovos_workshop.skills.common_play import OVOSCommonPlaybackSkill
# self.assertTrue(issubclass(OVOSCommonPlaybackSkill,
# PatchedMycroftSkill))
#
# try:
# from ovos_workshop.skills.common_query_skill import CommonQuerySkill
# self.assertTrue(issubclass(CommonQuerySkill, PatchedMycroftSkill))
# except ModuleNotFoundError:
# # Class added in ovos-workwhop 0.0.12
# pass


if __name__ == '__main__':
Expand Down
Loading