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

feat/runtime_requirements #8

Merged
merged 8 commits into from
Feb 10, 2023
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
41 changes: 0 additions & 41 deletions .github/workflows/license_tests.yml

This file was deleted.

14 changes: 14 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

from mycroft import MycroftSkill, intent_handler
from mycroft.skills import skill_api_method
from ovos_utils.process_utils import RuntimeRequirements
from ovos_utils import classproperty


class CameraSkill(MycroftSkill):
Expand All @@ -28,6 +30,18 @@ def __init__(self):
self.camera_mode = None
self.save_folder = None

@classproperty
def runtime_requirements(self):
return RuntimeRequirements(internet_before_load=False,
network_before_load=False,
gui_before_load=True,
requires_internet=False,
requires_network=False,
requires_gui=True,
no_internet_fallback=True,
no_network_fallback=True,
no_gui_fallback=False)

def initialize(self):
"""Perform any initial setup."""
self.save_folder = os.path.expanduser("~/Pictures")
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

ovos-utils~=0.0, >=0.0.28a4
ovos_workshop~=0.0, >=0.0.11a4
4 changes: 2 additions & 2 deletions test/osm_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from ovos_skills_manager import SkillEntry

branch = "dev"
url = f"https://github.com/OpenVoiceOS/ovos-skill-camera@{branch}"
url = f"https://github.com/OpenVoiceOS/skill-ovos-camera@{branch}"

class TestOSM(unittest.TestCase):
@classmethod
def setUpClass(self):
self.skill_id = "ovos-skill-camera.OpenVoiceOS"
self.skill_id = 'skill-ovos-camera.openvoiceos'

def test_osm_install(self):
skill = SkillEntry.from_github_url(url)
Expand Down
2 changes: 1 addition & 1 deletion test/plugin_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class TestPlugin(unittest.TestCase):
@classmethod
def setUpClass(self):
self.skill_id = "ovos-skill-camera.OpenVoiceOS"
self.skill_id = 'skill-ovos-camera.openvoiceos'

def test_find_plugin(self):
plugins = find_skill_plugins()
Expand Down
6 changes: 3 additions & 3 deletions test/unittests/test_skill_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from adapt.engine import IntentDeterminationEngine
from adapt.intent import IntentBuilder
from ovos_skill_camera import VolumeSkill, create_skill
from skill_ovos_camera import CameraSkill, create_skill
from ovos_plugin_manager.skills import find_skill_plugins
from ovos_utils.messagebus import FakeBus
from mycroft.skills.skill_loader import PluginSkillLoader, SkillLoader
Expand All @@ -15,12 +15,12 @@
class TestSkillLoading(unittest.TestCase):
@classmethod
def setUpClass(self):
self.skill_id = "ovos-skill-camera.OpenVoiceOS"
self.skill_id = 'skill-ovos-camera.openvoiceos'
self.path = dirname(dirname(dirname(__file__)))

def test_from_class(self):
bus = FakeBus()
skill = VolumeSkill()
skill = CameraSkill()
skill._startup(bus, self.skill_id)
self.assertEqual(skill.bus, bus)
self.assertEqual(skill.skill_id, self.skill_id)
Expand Down