Skip to content

Commit

Permalink
Merge pull request #320 from OpenVoiceOS/release-3.3.1a2
Browse files Browse the repository at this point in the history
Release 3.3.1a2
  • Loading branch information
JarbasAl authored Jan 4, 2025
2 parents 9fdc036 + ea45181 commit 972c0e3
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: '3.11'
- name: Install Build Tools
run: |
python -m pip install build wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: '3.11'
- name: Install Build Tools
run: |
python -m pip install build wheel
Expand Down
16 changes: 6 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# Changelog

## [3.3.0a1](https://github.com/OpenVoiceOS/OVOS-workshop/tree/3.3.0a1) (2024-12-31)
## [3.3.1a2](https://github.com/OpenVoiceOS/OVOS-workshop/tree/3.3.1a2) (2025-01-04)

[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/3.2.2a1...3.3.0a1)

**Closed issues:**

- refactor: simplify common query [\#314](https://github.com/OpenVoiceOS/OVOS-workshop/issues/314)
[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/3.3.1a1...3.3.1a2)

**Merged pull requests:**

- feat:common\_query\_decorator [\#315](https://github.com/OpenVoiceOS/OVOS-workshop/pull/315) ([JarbasAl](https://github.com/JarbasAl))
- refactor: simplify cq messages [\#319](https://github.com/OpenVoiceOS/OVOS-workshop/pull/319) ([JarbasAl](https://github.com/JarbasAl))

## [3.2.2a1](https://github.com/OpenVoiceOS/OVOS-workshop/tree/3.2.2a1) (2024-12-26)
## [3.3.1a1](https://github.com/OpenVoiceOS/OVOS-workshop/tree/3.3.1a1) (2025-01-04)

[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/3.2.1...3.2.2a1)
[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/3.3.0...3.3.1a1)

**Merged pull requests:**

- fix: voc\_match ignore case [\#312](https://github.com/OpenVoiceOS/OVOS-workshop/pull/312) ([JarbasAl](https://github.com/JarbasAl))
- chore: add warnings [\#317](https://github.com/OpenVoiceOS/OVOS-workshop/pull/317) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
7 changes: 7 additions & 0 deletions ovos_workshop/backwards_compat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import warnings
warnings.warn(
"will be removed soon",
DeprecationWarning,
stacklevel=2,
)

try: # TODO - remove this file in next stable release
from ovos_utils.ocp import *
except ImportError:
Expand Down
7 changes: 6 additions & 1 deletion ovos_workshop/decorators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import wraps
from typing import Optional, Callable
from ovos_utils.log import log_deprecation

import warnings
from ovos_workshop.decorators.killable import killable_intent, killable_event
from ovos_workshop.decorators.layers import enables_layer, \
disables_layer, layer_intent, removes_layer, resets_layers, replaces_layer
Expand Down Expand Up @@ -75,6 +75,11 @@ def intent_file_handler(intent_file: str):
"""
Deprecated decorator for adding a method as an intent file handler.
"""
warnings.warn(
"Use `@intent_handler' instead",
DeprecationWarning,
stacklevel=2,
)

def real_decorator(func):
# Store the intent_file inside the function
Expand Down
7 changes: 7 additions & 0 deletions ovos_workshop/decorators/converse.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
from ovos_utils.log import log_deprecation
import warnings

warnings.warn(
"Import from `ovos_workshop.decorators`",
DeprecationWarning,
stacklevel=2,
)


def converse_handler(func):
Expand Down
7 changes: 7 additions & 0 deletions ovos_workshop/decorators/fallback_handler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
from ovos_utils.log import log_deprecation

import warnings

warnings.warn(
"Import from `ovos_workshop.decorators`",
DeprecationWarning,
stacklevel=2,
)

def fallback_handler(priority=50):
log_deprecation("Import from `ovos_workshop.decorators`", "0.1.0")
Expand Down
12 changes: 11 additions & 1 deletion ovos_workshop/intents.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os.path import exists
from threading import RLock
from typing import List, Tuple, Optional

import warnings
from ovos_bus_client.message import Message, dig_for_message
from ovos_bus_client.util import get_mycroft_bus
from ovos_utils.log import LOG, log_deprecation
Expand Down Expand Up @@ -500,6 +500,11 @@ class expect intent_name; this was the weird one expecting the internal
name = intent_name.split(':')[1]
log_deprecation(f"Update to `self.remove_intent({name})",
"0.1.0")
warnings.warn(
"use `self.remove_intent' instead",
DeprecationWarning,
stacklevel=2,
)
self.remove_intent(name)

def remove_intent(self, intent_name: str):
Expand Down Expand Up @@ -614,6 +619,11 @@ def register_padatious_entity(self, entity_name: str, filename: str,

def get_intent_names(self):
log_deprecation("Reference `intent_names` directly", "0.1.0")
warnings.warn(
"use `self.intent_names' property instead",
DeprecationWarning,
stacklevel=2,
)
return self.intent_names

def detach_all(self):
Expand Down
2 changes: 1 addition & 1 deletion ovos_workshop/skill_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from ovos_plugin_manager.skills import find_skill_plugins, get_skill_directories
from ovos_utils import wait_for_exit_signal
from ovos_utils.file_utils import FileWatcher
from ovos_utils.log import LOG, deprecated, log_deprecation
from ovos_utils.log import LOG, log_deprecation
from ovos_utils.process_utils import RuntimeRequirements

from ovos_workshop.skills.active import ActiveSkill
Expand Down
9 changes: 7 additions & 2 deletions ovos_workshop/skills/common_query_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from ovos_bus_client import Message
from ovos_utils.file_utils import resolve_resource_file
from ovos_utils.log import LOG, log_deprecation

import warnings
from ovos_workshop.skills.ovos import OVOSSkill


Expand Down Expand Up @@ -60,6 +60,11 @@ class CommonQuerySkill(OVOSSkill):

def __init__(self, *args, **kwargs):
log_deprecation("'CommonQuerySkill' class has been deprecated, use @common_query decorator with regular OVOSSkill instead", "4.0.0")
warnings.warn(
"use '@common_query' decorator with regular OVOSSkill instead",
DeprecationWarning,
stacklevel=2,
)
# these should probably be configurable
self.level_confidence = {
CQSMatchLevel.EXACT: 0.9,
Expand Down Expand Up @@ -120,7 +125,7 @@ def bind(self, bus):
# announce skill to ovos-core
def __handle_common_query_ping(self, message):
self.bus.emit(message.reply("ovos.common_query.pong",
{"skill_id": self.skill_id},
{"skill_id": self.skill_id, "is_classic_cq": True},
{"skill_id": self.skill_id}))

def __handle_question_query(self, message: Message):
Expand Down
16 changes: 16 additions & 0 deletions ovos_workshop/skills/intent_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
from ovos_bus_client.message import Message
from ovos_workshop.skills.fallback import FallbackSkill
from ovos_config.config import read_mycroft_config, update_mycroft_config
import warnings

warnings.warn(
"use pipeline plugins instead",
DeprecationWarning,
stacklevel=2,
)

class BaseIntentEngine:
def __init__(self, name, config=None):
warnings.warn(
"make a pipeline plugin instead",
DeprecationWarning,
stacklevel=2,
)
log_deprecation("This base class is not supported", "0.1.0")
self.name = name.lower()
config = config or read_mycroft_config()
Expand Down Expand Up @@ -51,6 +62,11 @@ def calc_intent(self, query):

class IntentEngineSkill(FallbackSkill):
def __init__(self, *args, **kwargs):
warnings.warn(
"make a pipeline plugin instead",
DeprecationWarning,
stacklevel=2,
)
log_deprecation("This base class is not supported", "0.1.0")
super().__init__(*args, **kwargs)
self.engine = None
Expand Down
7 changes: 7 additions & 0 deletions ovos_workshop/skills/layers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
from ovos_workshop.decorators.layers import IntentLayers
from ovos_utils.log import log_deprecation
log_deprecation("Import from `ovos_workshop.decorators.layers`", "0.1.0")
import warnings

warnings.warn(
"Import from `ovos_workshop.decorators.layers`",
DeprecationWarning,
stacklevel=2,
)
17 changes: 14 additions & 3 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ def __handle_common_query_ping(self, message):
if self._cq_handler:
# announce skill to common query pipeline
self.bus.emit(message.reply("ovos.common_query.pong",
{"skill_id": self.skill_id},
{"skill_id": self.skill_id, "is_classic_cq": False},
{"skill_id": self.skill_id}))

def __handle_query_action(self, message: Message):
Expand All @@ -1049,9 +1049,19 @@ def __handle_query_action(self, message: Message):
@param message: `question:action` message
"""
# backwards compat, for older common query pipeline versions
if not self._cq_callback or message.data["skill_id"] != self.skill_id:
# Not for this skill!
return
# call the correct handler as if cq was updated
message.msg_type += f".{self.skill_id}"
self.bus.emit(message)

def __handle_skill_query_action(self, message: Message):
if not self._cq_callback:
LOG.debug(f"no common query callback registered for: {self.skill_id}")
return # nothing to do

LOG.debug(f"common query callback for: {self.skill_id}")
lang = get_message_lang(message)
answer = message.data.get("answer") or message.data.get("callback_data", {}).get("answer")
Expand Down Expand Up @@ -1175,8 +1185,9 @@ def _register_system_event_handlers(self):

self.add_event('question:query', self.__handle_question_query, speak_errors=False)
self.add_event("ovos.common_query.ping", self.__handle_common_query_ping, speak_errors=False)
self.add_event('question:action', self.__handle_query_action,
handler_info='mycroft.skill.handler', is_intent=True, speak_errors=False)
self.add_event(f'question:action.{self.skill_id}', self.__handle_skill_query_action,
handler_info='mycroft.skill.handler', is_intent=True, speak_errors=False)
self.add_event('question:action', self.__handle_query_action, speak_errors=False)

# homescreen might load after this skill and miss the original events
self.add_event("homescreen.metadata.get", self.handle_homescreen_loaded, speak_errors=False)
Expand Down
4 changes: 2 additions & 2 deletions ovos_workshop/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 3
VERSION_MINOR = 3
VERSION_BUILD = 0
VERSION_ALPHA = 0
VERSION_BUILD = 1
VERSION_ALPHA = 2
# END_VERSION_BLOCK

0 comments on commit 972c0e3

Please sign in to comment.