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

chore: fix pyee import, maintain backwards compat #140

Merged
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
51 changes: 27 additions & 24 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,41 @@ on:
branches:
- dev
paths-ignore:
- 'ovos_bus_client/version.py'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'README.md'
- 'scripts/**'
- "ovos_bus_client/version.py"
- "examples/**"
- ".github/**"
- ".gitignore"
- "LICENSE"
- "CHANGELOG.md"
- "MANIFEST.in"
- "README.md"
- "scripts/**"
push:
branches:
- master
paths-ignore:
- 'ovos_bus_client/version.py'
- 'requirements/**'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'README.md'
- 'scripts/**'
- "ovos_bus_client/version.py"
- "examples/**"
- ".github/**"
- ".gitignore"
- "LICENSE"
- "CHANGELOG.md"
- "MANIFEST.in"
- "README.md"
- "scripts/**"
workflow_dispatch:

jobs:
unit_tests:
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9, '3.10']
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install System Dependencies
Expand All @@ -59,10 +58,14 @@ jobs:
# NOTE: additional pytest invocations should also add the --cov-append flag
# or they will overwrite previous invocations' coverage reports
# (for an example, see OVOS Skill Manager's workflow)
- name: Maintain Pyee backwards compat
run: |
pip install -U "pyee==8.1.0"
pytest --cov=ovos_bus_client --cov-report=xml --cov-append test/unittests
- name: Upload coverage
if: "${{ matrix.python-version == '3.9' }}"
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
token: ${{secrets.CODECOV_TOKEN}}
files: coverage.xml
verbose: true
verbose: true
6 changes: 5 additions & 1 deletion ovos_bus_client/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
from uuid import uuid4

from ovos_utils.log import LOG, deprecated
from pyee import ExecutorEventEmitter
try:
from pyee import ExecutorEventEmitter
except (ImportError, ModuleNotFoundError):
from pyee.executor import ExecutorEventEmitter

from websocket import (WebSocketApp,
WebSocketConnectionClosedException,
WebSocketException)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ovos-config>=0.0.12,<1.0.0
ovos-utils>=0.3.5,<1.0.0
websocket-client>=0.54.0
pyee>=8.1.0, < 12.0.0
pyee>= 8.1.0, < 13.0.0
orjson
5 changes: 4 additions & 1 deletion test/unittests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
import unittest
from unittest.mock import call, Mock, patch

from pyee import ExecutorEventEmitter
try:
from pyee import ExecutorEventEmitter
except (ImportError, ModuleNotFoundError):
from pyee.executor import ExecutorEventEmitter

from ovos_bus_client.message import Message
from ovos_bus_client.client.client import MessageBusClient, GUIWebsocketClient
Expand Down
6 changes: 5 additions & 1 deletion test/unittests/test_event_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

import unittest
import time
from pyee import ExecutorEventEmitter
try:
from pyee import ExecutorEventEmitter
except (ImportError, ModuleNotFoundError):
from pyee.executor import ExecutorEventEmitter


from unittest.mock import MagicMock, patch
from ovos_utils.messagebus import FakeBus
Expand Down
Loading