Skip to content

Commit cdd67da

Browse files
authored
chore: update dependencies (#10)
1 parent 092337a commit cdd67da

File tree

4 files changed

+742
-398
lines changed

4 files changed

+742
-398
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [ubuntu-20.04, windows-latest, macOS-11]
17-
python_version: [3.11]
16+
os: [ubuntu-latest, windows-latest, macOS-latest]
17+
python_version: [3.13]
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020
with:
2121
submodules: 'recursive'
2222
- name: Set up Python
23-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v5
2424
with:
2525
python-version: ${{ matrix.python_version }}
2626
- name: Create virtualenv
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install dependencies
3131
shell: bash
3232
run: |
33-
pip install poetry==1.3.2 # due to: https://github.com/python-poetry/poetry/issues/7611
33+
pip install poetry
3434
source venv/bin/activate || source venv/Scripts/activate
3535
poetry install
3636
- name: Run tests

aw_notify/main.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
and send notifications to the user on predefined conditions.
44
"""
55

6+
import asyncio
67
import logging
78
import shutil
89
import subprocess
@@ -23,7 +24,7 @@
2324
import aw_client.queries
2425
import click
2526
from aw_core.log import setup_logging
26-
from desktop_notifier import DesktopNotifier
27+
from desktop_notifier import DesktopNotifier, Icon
2728
from typing_extensions import TypeAlias
2829

2930
logger = logging.getLogger(__name__)
@@ -161,10 +162,19 @@ def notify(title: str, msg: str):
161162
if notifier is None:
162163
notifier = DesktopNotifier(
163164
app_name="AW",
164-
app_icon=f"file://{icon_path}",
165+
app_icon=Icon(uri=f"file://{icon_path}"),
165166
notification_limit=10,
166167
)
167-
notifier.send_sync(title=title, message=msg)
168+
169+
# Get or create event loop
170+
try:
171+
loop = asyncio.get_running_loop()
172+
except RuntimeError:
173+
loop = asyncio.new_event_loop()
174+
asyncio.set_event_loop(loop)
175+
176+
# Send notification
177+
loop.run_until_complete(notifier.send(title=title, message=msg))
168178
return
169179
except Exception as e:
170180
logger.info(f"desktop-notifier not used: {e}")

0 commit comments

Comments
 (0)