diff --git a/CHANGELOG.md b/CHANGELOG.md index a88952a..b0595c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,23 @@ # Changelog -## [0.3.6a1](https://github.com/OpenVoiceOS/ovos-utils/tree/0.3.6a1) (2024-10-21) +## [0.3.7a1](https://github.com/OpenVoiceOS/ovos-utils/tree/0.3.7a1) (2024-11-04) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/0.3.5...0.3.6a1) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/0.3.6...0.3.7a1) + +**Fixed bugs:** + +- Should be 0.1.0; is there a bug in the version automation? [\#244](https://github.com/OpenVoiceOS/ovos-utils/issues/244) + +**Closed issues:** + +- system.py - Added method should get a docstring and type annotation [\#243](https://github.com/OpenVoiceOS/ovos-utils/issues/243) +- skills.py - This should get type annotations and a docstring [\#242](https://github.com/OpenVoiceOS/ovos-utils/issues/242) +- setup.py - This should be updated to an absolute path for automations [\#240](https://github.com/OpenVoiceOS/ovos-utils/issues/240) **Merged pull requests:** -- Update ovos-workshop requirement from \<1.0.0,\>=0.0.13 to \>=0.0.13,\<2.0.0 in /requirements [\#289](https://github.com/OpenVoiceOS/ovos-utils/pull/289) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Update ovos-workshop requirement from \<2.0.0,\>=0.0.13 to \>=0.0.13,\<3.0.0 in /requirements [\#292](https://github.com/OpenVoiceOS/ovos-utils/pull/292) ([dependabot[bot]](https://github.com/apps/dependabot)) +- chore: update docstrings and type hints [\#291](https://github.com/OpenVoiceOS/ovos-utils/pull/291) ([mikejgray](https://github.com/mikejgray)) diff --git a/ovos_utils/skills.py b/ovos_utils/skills.py index d38e041..51b3408 100644 --- a/ovos_utils/skills.py +++ b/ovos_utils/skills.py @@ -26,7 +26,15 @@ def check_class(cls): return set(check_class(obj.__class__)) -def skills_loaded(bus=None): +def skills_loaded(bus=None) -> bool: + """ + Await a reply from mycroft.skills.all_loaded to check if all skills are + loaded. + @param bus: OVOS messagebus client + @return: Are all skills loaded? True/False + """ + if bus is None: + return False reply = wait_for_reply('mycroft.skills.all_loaded', 'mycroft.skills.all_loaded.response', bus=bus) diff --git a/ovos_utils/system.py b/ovos_utils/system.py index 88b9a3a..959ebfd 100644 --- a/ovos_utils/system.py +++ b/ovos_utils/system.py @@ -7,7 +7,11 @@ from ovos_utils.log import LOG, deprecated -def is_running_from_module(module_name): +def is_running_from_module(module_name: str) -> bool: + """ + Check and see if the code is being run from a specific module + @param module_name: name of the module to check for + """ # Stack: # [0] - _log() # [1] - debug(), info(), warning(), or error() @@ -91,28 +95,6 @@ def restart_mycroft_service(sudo=True, user=False): """ restart_service("mycroft.service", sudo=sudo, user=user) -def is_running_from_module(module_name): - # Stack: - # [0] - _log() - # [1] - debug(), info(), warning(), or error() - # [2] - caller - stack = inspect.stack() - - # Record: - # [0] - frame object - # [1] - filename - # [2] - line number - # [3] - function - # ... - for record in stack[2:]: - mod = inspect.getmodule(record[0]) - name = mod.__name__ if mod else '' - # module name in file path of caller - # or import name matches module name - if f"/{module_name}/" in record[1] or \ - name.startswith(module_name.replace("-", "_").replace(" ", "_")): - return True - return False def restart_service(service_name, sudo=True, user=False): """ diff --git a/ovos_utils/version.py b/ovos_utils/version.py index 8ddb69f..844ba08 100644 --- a/ovos_utils/version.py +++ b/ovos_utils/version.py @@ -1,6 +1,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 3 -VERSION_BUILD = 6 -VERSION_ALPHA = 0 +VERSION_BUILD = 7 +VERSION_ALPHA = 1 # END_VERSION_BLOCK diff --git a/requirements/extras.txt b/requirements/extras.txt index 85a9ed9..50c564c 100644 --- a/requirements/extras.txt +++ b/requirements/extras.txt @@ -1,5 +1,5 @@ rapidfuzz>=3.6,<4.0 ovos-plugin-manager>=0.0.25,<1.0.0 ovos-config>=0.0.12,<1.0.0 -ovos-workshop>=0.0.13,<2.0.0 +ovos-workshop>=0.0.13,<3.0.0 ovos_bus_client>=0.0.8,<1.0.0