From b1a15a5f1608c6b8b3704566297ada54257a3c11 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 20 Sep 2024 09:48:34 -0700 Subject: [PATCH 1/6] Update OCP imports to ovos-utils Update ovos-utils dependency to 0.1 for import compat --- __init__.py | 2 +- requirements.txt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/__init__.py b/__init__.py index 32e8a3d..d6c8143 100644 --- a/__init__.py +++ b/__init__.py @@ -34,7 +34,7 @@ from urllib.parse import quote from bs4 import BeautifulSoup from neon_utils.file_utils import load_commented_file -from ovos_plugin_common_play import MediaType, PlaybackType +from ovos_utils.ocp import MediaType, PlaybackType from ovos_workshop.skills.common_play import OVOSCommonPlaybackSkill, \ ocp_search from ovos_utils import classproperty diff --git a/requirements.txt b/requirements.txt index 20041a7..d720e55 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,4 @@ ovos-workshop~=0.0,>=0.0.7 beautifulsoup4~=4.11 # TODO: network patching dependency resolution neon-utils[network]~=1.0,>=1.11.1a3 -ovos-plugin-common-play~=0.0.3 -ovos-utils~=0.0, >=0.0.28 +ovos-utils~=0.1 From 5ff0332c31d27d940eb1c5bb41a21d1b5767e50a Mon Sep 17 00:00:00 2001 From: NeonDaniel Date: Fri, 20 Sep 2024 16:49:26 +0000 Subject: [PATCH 2/6] Update skill.json --- skill.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/skill.json b/skill.json index a71039d..af93f1f 100644 --- a/skill.json +++ b/skill.json @@ -17,8 +17,7 @@ "python": [ "beautifulsoup4~=4.11", "neon-utils[network]~=1.0,>=1.11.1a3", - "ovos-plugin-common-play~=0.0.3", - "ovos-utils~=0.0, >=0.0.28", + "ovos-utils~=0.1", "ovos-workshop~=0.0,>=0.0.7" ], "system": {}, From 2e19ef71ef8ff854fdb672db395694b258c09269 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 20 Sep 2024 09:55:11 -0700 Subject: [PATCH 3/6] Refactor for backwards-compat --- __init__.py | 7 +++++-- requirements.txt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/__init__.py b/__init__.py index d6c8143..b172a16 100644 --- a/__init__.py +++ b/__init__.py @@ -34,13 +34,16 @@ from urllib.parse import quote from bs4 import BeautifulSoup from neon_utils.file_utils import load_commented_file -from ovos_utils.ocp import MediaType, PlaybackType from ovos_workshop.skills.common_play import OVOSCommonPlaybackSkill, \ ocp_search from ovos_utils import classproperty from ovos_utils.log import LOG from ovos_utils.process_utils import RuntimeRequirements - +try: + from ovos_utils.ocp import MediaType, PlaybackType +except ImportError: + # TODO: Pin ovos-utils 0.1 and remove this once supported in NeonCore + from ovos_workshop.backwards_compat import MediaType, PlaybackType class FreeMusicArchiveSkill(OVOSCommonPlaybackSkill): def __init__(self, **kwargs): diff --git a/requirements.txt b/requirements.txt index d720e55..5a37558 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ ovos-workshop~=0.0,>=0.0.7 beautifulsoup4~=4.11 # TODO: network patching dependency resolution neon-utils[network]~=1.0,>=1.11.1a3 -ovos-utils~=0.1 +ovos-utils~=0.0, >=0.0.28 From 90de45e1b428b2d0b4552d7d4bfbd23f6e79969c Mon Sep 17 00:00:00 2001 From: NeonDaniel Date: Fri, 20 Sep 2024 16:56:12 +0000 Subject: [PATCH 4/6] Update skill.json --- skill.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skill.json b/skill.json index af93f1f..71eb977 100644 --- a/skill.json +++ b/skill.json @@ -17,7 +17,7 @@ "python": [ "beautifulsoup4~=4.11", "neon-utils[network]~=1.0,>=1.11.1a3", - "ovos-utils~=0.1", + "ovos-utils~=0.0, >=0.0.28", "ovos-workshop~=0.0,>=0.0.7" ], "system": {}, From 5f16016f0f80670491b9e26fa0f189d62847e561 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 20 Sep 2024 09:57:22 -0700 Subject: [PATCH 5/6] Update missed import in unit tests --- test/test_skill.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_skill.py b/test/test_skill.py index 406b83f..9eeab0d 100644 --- a/test/test_skill.py +++ b/test/test_skill.py @@ -28,7 +28,7 @@ import pytest -from ovos_plugin_common_play import MediaType +from ovos_workshop.backwards_compat import MediaType from neon_minerva.tests.skill_unit_test_base import SkillTestCase From d1e5468effd6f3a74c1f173a3c06794edcc82c7e Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 20 Sep 2024 10:02:14 -0700 Subject: [PATCH 6/6] Update backwards-compat imports --- __init__.py | 5 +++-- test/test_skill.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/__init__.py b/__init__.py index b172a16..a28637f 100644 --- a/__init__.py +++ b/__init__.py @@ -42,8 +42,9 @@ try: from ovos_utils.ocp import MediaType, PlaybackType except ImportError: - # TODO: Pin ovos-utils 0.1 and remove this once supported in NeonCore - from ovos_workshop.backwards_compat import MediaType, PlaybackType + # TODO: Update import to ovos-utils when 0.1 is pinned as a minimum version + from ovos_workshop.decorators.ocp import MediaType, PlaybackType + class FreeMusicArchiveSkill(OVOSCommonPlaybackSkill): def __init__(self, **kwargs): diff --git a/test/test_skill.py b/test/test_skill.py index 9eeab0d..b6b8f8b 100644 --- a/test/test_skill.py +++ b/test/test_skill.py @@ -28,7 +28,8 @@ import pytest -from ovos_workshop.backwards_compat import MediaType +# TODO: Update import to ovos-utils when 0.1 is pinned as a minimum version +from ovos_workshop.decorators.ocp import MediaType from neon_minerva.tests.skill_unit_test_base import SkillTestCase