Skip to content

Commit

Permalink
Merge pull request #305 from OpenVoiceOS/release-0.5.1a1
Browse files Browse the repository at this point in the history
Release 0.5.1a1
  • Loading branch information
JarbasAl authored Nov 21, 2024
2 parents 3c73316 + 601324f commit d789872
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 32 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Changelog

## [0.5.0a1](https://github.com/OpenVoiceOS/ovos-utils/tree/0.5.0a1) (2024-11-20)
## [0.5.1a1](https://github.com/OpenVoiceOS/ovos-utils/tree/0.5.1a1) (2024-11-21)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/0.4.1...0.5.0a1)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/0.5.0...0.5.1a1)

**Merged pull requests:**

- feat:oauth utils to ovos-utils and deprecate backend-client [\#301](https://github.com/OpenVoiceOS/ovos-utils/pull/301) ([JarbasAl](https://github.com/JarbasAl))
- fix: remove mycroft-bus-client compat [\#304](https://github.com/OpenVoiceOS/ovos-utils/pull/304) ([JarbasAl](https://github.com/JarbasAl))
- chore: support newer pyee [\#303](https://github.com/OpenVoiceOS/ovos-utils/pull/303) ([mikejgray](https://github.com/mikejgray))



Expand Down
2 changes: 1 addition & 1 deletion ovos_utils/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from inspect import signature
from typing import Callable, Optional, Union

from ovos_utils.fakebus import Message, FakeBus, dig_for_message
from ovos_utils.fakebus import FakeMessage as Message, FakeBus, dig_for_message
from ovos_utils.file_utils import to_alnum
from ovos_utils.log import LOG

Expand Down
21 changes: 3 additions & 18 deletions ovos_utils/fakebus.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def on_message(self, *args):
message = args[0]
else:
message = args[1]
parsed_message = Message.deserialize(message)
parsed_message = FakeMessage.deserialize(message)
try: # replicate side effects
from ovos_bus_client.session import Session, SessionManager
sess = Session.from_message(parsed_message)
Expand Down Expand Up @@ -173,12 +173,6 @@ def __instancecheck__(self, instance):
return True
except ImportError:
pass
try:
from mycroft_bus_client.message import Message as _MycroftMessage
if isinstance(instance, _MycroftMessage):
return True
except ImportError:
pass
return super().__instancecheck__(instance)


Expand All @@ -192,11 +186,8 @@ def __new__(cls, *args, **kwargs):
return _M(*args, **kwargs)
except ImportError:
pass
try: # some old install that upgraded during migration period
from mycroft_bus_client import Message as _M
return _M(*args, **kwargs)
except ImportError: # FakeMessage
return super().__new__(cls)
return super().__new__(cls)


def __init__(self, msg_type, data=None, context=None):
"""Used to construct a message object
Expand Down Expand Up @@ -339,9 +330,3 @@ def publish(self, msg_type, data, context=None):

return FakeMessage(msg_type, data, context=new_context)


class Message(FakeMessage):
def __int__(self, *args, **kwargs):
log_deprecation(f"Import from ovos_bus_client.message directly",
"0.1.0")
FakeMessage.__init__(self, *args, **kwargs)
1 change: 0 additions & 1 deletion ovos_utils/messagebus.py

This file was deleted.

4 changes: 2 additions & 2 deletions ovos_utils/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 0
VERSION_MINOR = 5
VERSION_BUILD = 0
VERSION_ALPHA = 0
VERSION_BUILD = 1
VERSION_ALPHA = 1
# END_VERSION_BLOCK
8 changes: 2 additions & 6 deletions test/unittests/test_event_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

import unittest
import time
from pyee import ExecutorEventEmitter

from unittest.mock import MagicMock, patch
from ovos_utils.messagebus import FakeBus
from ovos_utils.fakebus import FakeBus
from ovos_bus_client.util.scheduler import EventScheduler, EventSchedulerInterface


Expand Down Expand Up @@ -107,8 +105,6 @@ def test_shutdown(self):
def f(message):
print('TEST FUNC')

bus = ExecutorEventEmitter()

es = EventSchedulerInterface('tester')
es.set_bus(FakeBus())
es.set_id('id')
Expand All @@ -120,4 +116,4 @@ def f(message):
es.shutdown()
# Check that the reference to the function has been removed from the
# bus emitter
self.assertTrue(len(bus._events.get('id:f', [])) == 0)
self.assertTrue(len(es.bus.ee._events.get('id:f', [])) == 0)
2 changes: 1 addition & 1 deletion test/unittests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from time import time
from unittest.mock import Mock

from ovos_utils.fakebus import FakeBus, Message
from ovos_utils.fakebus import FakeBus, FakeMessage as Message


class TestEvents(unittest.TestCase):
Expand Down

0 comments on commit d789872

Please sign in to comment.