Skip to content

Commit ce8dbab

Browse files
committed
more massive refactoring
1 parent cbc4ee8 commit ce8dbab

24 files changed

Lines changed: 398 additions & 457 deletions

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# .github/workflows/lint.yml
2+
name: Run Lint Checks
3+
4+
on:
5+
push:
6+
paths:
7+
- '**.py'
8+
pull_request:
9+
paths:
10+
- '**.py'
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.12'
23+
24+
- name: Install tox
25+
run: python -m pip install tox
26+
27+
- name: Run Ruff lint check
28+
run: tox -e lint

.github/workflows/tests.yml

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,43 @@ on:
1313
jobs:
1414
test:
1515
name: Python ${{ matrix.python-version }} – ${{ matrix.tox_env }} on ${{ matrix.os }}
16-
runs-on: ubuntu-latest
16+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
1717

1818
strategy:
1919
fail-fast: false # Let all jobs run, even if one fails
2020
matrix:
2121
include:
22-
- python-version: "3.8"
23-
tox_env: qa
24-
setup_python: true
25-
26-
# Modern Python versions (can rely on default runner environment)
2722
- python-version: "3.9"
2823
tox_env: qa
29-
setup_python: false
3024
- python-version: "3.10"
3125
tox_env: qa
32-
setup_python: false
3326
- python-version: "3.11"
3427
tox_env: qa
35-
setup_python: false
3628
- python-version: "3.12"
3729
tox_env: qa
38-
setup_python: false
30+
31+
# Pre-release testing (won't fail entire workflow if this fails)
32+
- python-version: "3.13-dev"
33+
tox_env: qa
34+
continue-on-error: true
3935

4036
# Platform validation only (one version)
4137
- os: windows-latest
42-
python-version: "3.11"
38+
python-version: "3.12"
4339
tox_env: qa
4440

4541
- os: macos-latest
46-
python-version: "3.11"
42+
python-version: "3.12"
4743
tox_env: qa
4844

4945
# Minimal test run on latest Python only
5046
# this verifies Apprise still works when extra libraries are not available
5147
- python-version: "3.12"
5248
tox_env: minimal
53-
setup_python: false
54-
5549

5650
steps:
5751
- uses: actions/checkout@v4
5852

59-
# Legacy Python versions 3.8 are no longer on GitHub-hosted runners
60-
# Use setup-python to install them explicitly
61-
- name: Set up Python (legacy)
62-
if: matrix.setup_python
63-
uses: actions/setup-python@v5
64-
with:
65-
python-version: ${{ matrix.python-version }}
66-
6753
# Install tox for isolated environment and plugin test orchestration
6854
- name: Install tox
6955
run: python -m pip install tox
@@ -72,13 +58,6 @@ jobs:
7258
- name: Run tox for ${{ matrix.tox_env }}
7359
run: tox -e ${{ matrix.tox_env }}
7460

75-
- name: Verify .coverage file existence
76-
if: always()
77-
run: |
78-
echo "::group::Looking for .coverage file"
79-
ls -alh .
80-
echo "::endgroup::"
81-
8261
- name: Upload coverage report
8362
if: always()
8463
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ env/
1818
.venv*
1919
build/
2020
BUILDROOT/
21+
SOURCES/
22+
SRPMS/
2123
develop-eggs/
2224
dist/
2325
downloads/

CONTRIBUTIONS.md renamed to ACKNOWLEDGEMENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributions to the apprise project
1+
# Contributions to the Apprise Project
22

33
## Creator & Maintainer
44

CONTRIBUTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# 🤝 Contributing to Apprise
2+
3+
Thank you for your interest in contributing to Apprise!
4+
5+
We welcome bug reports, feature requests, documentation improvements, and new
6+
notification plugins. Please follow the guidelines below to help us review and
7+
merge your contributions smoothly.
8+
9+
---
10+
11+
## ✅ Quick Checklist Before You Submit
12+
13+
- ✔️ Your code passes all lint checks:
14+
```bash
15+
tox -e lint
16+
```
17+
18+
- ✔️ Your changes are covered by tests:
19+
```bash
20+
tox -e qa
21+
```
22+
23+
- ✔️ All tests pass locally.
24+
25+
- ✔️ Your code is clean and consistently formatted:
26+
```bash
27+
tox -e format
28+
```
29+
30+
- ✔️ You followed the plugin template (if adding a new plugin).
31+
- ✔️ You included inline docstrings and respected the BSD 2-Clause license.
32+
- ✔️ Your commit message is descriptive.
33+
34+
---
35+
36+
## 📌 How to Contribute
37+
38+
1. **Fork the repository** and create a new branch.
39+
2. Make your changes.
40+
3. Run the checks listed above.
41+
4. Submit a pull request (PR) to the `main` branch.
42+
43+
GitHub Actions will run tests and lint checks on your PR automatically.
44+
45+
---
46+
47+
## 🧪 Need Help with Testing or Plugins?
48+
49+
See [DEVELOPMENT.md](./DEVELOPMENT.md) for:
50+
- Full setup instructions
51+
- Tox environment descriptions
52+
- RPM testing
53+
- Plugin development guidance
54+
55+
---
56+
57+
## 🙏 Thank You
58+
59+
Your contributions make Apprise better for everyone — thank you!
60+
61+
📝 See [ACKNOWLEDGEMENTS.md](./ACKNOWLEDGEMENTS.md) for a list of contributors.

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
include LICENSE
22
include README.md
3+
include CONTRIBUTING.md
4+
include ACKNOWLEDGEMENTS.md
35
include pyproject.toml
46
include tox.ini
57
include requirements.txt

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Apprise have some email services built right into it (such as yahoo, fastmail, h
207207

208208
# Installation
209209

210-
The easiest way is to install this package is from pypi:
210+
The easiest way is to install Apprise from PyPI:
211211
```bash
212212
pip install apprise
213213
```
@@ -223,7 +223,7 @@ yum install apprise
223223
dnf install apprise
224224
```
225225

226-
You can also check out the [Graphical version of Apprise](https://github.com/caronc/apprise-api) to centralize your configuration and notifications through a managable webpage.
226+
You can also check out the [Graphical version of Apprise](https://github.com/caronc/apprise-api) to centralize your configuration and notifications through a manageable webpage.
227227

228228
# Command Line Usage
229229

@@ -356,7 +356,7 @@ apprise -vv --title 'custom override' \
356356
--body 'the body of my message' \
357357
foobar:\\
358358

359-
# However you can over-ride the path like so
359+
# However you can override the path like so
360360
apprise -vv --title 'custom override' \
361361
--body 'the body of my message' \
362362
--plugin-path /path/to/my/plugin.py \
@@ -371,10 +371,10 @@ Those using the Command Line Interface (CLI) can also leverage environment varia
371371

372372
| Variable | Description |
373373
|------------------------ | ----------------- |
374-
| `APPRISE_URLS` | Specify the default URLs to notify IF none are otherwise specified on the command line explicitly. If the `--config` (`-c`) is specified, then this will over-rides any reference to this variable. Use white space and/or a comma (`,`) to delimit multiple entries.
375-
| `APPRISE_CONFIG_PATH` | Explicitly specify the config search path to use (over-riding the default). The path(s) defined here must point to the absolute filename to open/reference. Use a semi-colon (`;`), line-feed (`\n`), and/or carriage return (`\r`) to delimit multiple entries.
376-
| `APPRISE_PLUGIN_PATH` | Explicitly specify the custom plugin search path to use (over-riding the default). Use a semi-colon (`;`), line-feed (`\n`), and/or carriage return (`\r`) to delimit multiple entries.
377-
| `APPRISE_STORAGE_PATH` | Explicitly specify the persistent storage path to use (over-riding the default).
374+
| `APPRISE_URLS` | Specify the default URLs to notify IF none are otherwise specified on the command line explicitly. If the `--config` (`-c`) is specified, then this will overrides any reference to this variable. Use white space and/or a comma (`,`) to delimit multiple entries.
375+
| `APPRISE_CONFIG_PATH` | Explicitly specify the config search path to use (overriding the default). The path(s) defined here must point to the absolute filename to open/reference. Use a semi-colon (`;`), line-feed (`\n`), and/or carriage return (`\r`) to delimit multiple entries.
376+
| `APPRISE_PLUGIN_PATH` | Explicitly specify the custom plugin search path to use (overriding the default). Use a semi-colon (`;`), line-feed (`\n`), and/or carriage return (`\r`) to delimit multiple entries.
377+
| `APPRISE_STORAGE_PATH` | Explicitly specify the persistent storage path to use (overriding the default).
378378

379379
# Developer API Usage
380380

@@ -447,7 +447,7 @@ apobj.notify(
447447
apobj.notify(
448448
body='send a notification to our admin group',
449449
title='Attention Admins',
450-
# notify absolutely everything loaded, regardless on wether
450+
# notify absolutely everything loaded, regardless on whether
451451
# it has a tag associated with it or not:
452452
tag='all',
453453
)

apprise/persistent_store.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,8 @@ def hash(self):
147147
"""
148148
Our checksum to track the validity of our data
149149
"""
150-
try:
151-
return self.hash_engine(
152-
str(self).encode('utf-8'), usedforsecurity=False).hexdigest()
153-
154-
except TypeError:
155-
# Python <= v3.8 - usedforsecurity flag does not work
156-
return self.hash_engine(str(self).encode('utf-8')).hexdigest()
150+
return self.hash_engine(
151+
str(self).encode('utf-8'), usedforsecurity=False).hexdigest()
157152

158153
def json(self):
159154
"""

apprise/plugins/emby.py

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -691,46 +691,4 @@ def __del__(self):
691691
"""
692692
Destructor
693693
"""
694-
try:
695-
self.logout()
696-
697-
except LookupError: # pragma: no cover
698-
# Python v3.5 call to requests can sometimes throw the exception
699-
# "/usr/lib64/python3.7/socket.py", line 748, in getaddrinfo
700-
# LookupError: unknown encoding: idna
701-
#
702-
# This occurs every time when running unit-tests against Apprise:
703-
# LANG=C.UTF-8 PYTHONPATH=$(pwd) py.test-3.7
704-
#
705-
# There has been an open issue on this since Jan 2017.
706-
# - https://bugs.python.org/issue29288
707-
#
708-
# A ~similar~ issue can be identified here in the requests
709-
# ticket system as unresolved and has provided workarounds
710-
# - https://github.com/kennethreitz/requests/issues/3578
711-
pass
712-
713-
except ImportError: # pragma: no cover
714-
# The actual exception is `ModuleNotFoundError` however ImportError
715-
# grants us backwards compatibility with versions of Python older
716-
# than v3.6
717-
718-
# Python code that makes early calls to sys.exit() can cause
719-
# the __del__() code to run. However, in some newer versions of
720-
# Python, this causes the `sys` library to no longer be
721-
# available. The stack overflow also goes on to suggest that
722-
# it's not wise to use the __del__() as a destructor
723-
# which is the case here.
724-
725-
# https://stackoverflow.com/questions/67218341/\
726-
# modulenotfounderror-import-of-time-halted-none-in-sys-\
727-
# modules-occured-when-obj?noredirect=1&lq=1
728-
#
729-
#
730-
# Also see: https://stackoverflow.com/questions\
731-
# /1481488/what-is-the-del-method-and-how-do-i-call-it
732-
733-
# At this time it seems clean to try to log out (if we can)
734-
# but not throw any unnecessary exceptions (like this one) to
735-
# the end user if we don't have to.
736-
pass
694+
self.logout()

apprise/plugins/matrix.py

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,49 +1408,7 @@ def __del__(self):
14081408
and self.access_token == self.password and not self.user:
14091409
return
14101410

1411-
try:
1412-
self._logout()
1413-
1414-
except LookupError: # pragma: no cover
1415-
# Python v3.5 call to requests can sometimes throw the exception
1416-
# "/usr/lib64/python3.7/socket.py", line 748, in getaddrinfo
1417-
# LookupError: unknown encoding: idna
1418-
#
1419-
# This occurs every time when running unit-tests against Apprise:
1420-
# LANG=C.UTF-8 PYTHONPATH=$(pwd) py.test-3.7
1421-
#
1422-
# There has been an open issue on this since Jan 2017.
1423-
# - https://bugs.python.org/issue29288
1424-
#
1425-
# A ~similar~ issue can be identified here in the requests
1426-
# ticket system as unresolved and has provided workarounds
1427-
# - https://github.com/kennethreitz/requests/issues/3578
1428-
pass
1429-
1430-
except ImportError: # pragma: no cover
1431-
# The actual exception is `ModuleNotFoundError` however ImportError
1432-
# grants us backwards compatibility with versions of Python older
1433-
# than v3.6
1434-
1435-
# Python code that makes early calls to sys.exit() can cause
1436-
# the __del__() code to run. However, in some newer versions of
1437-
# Python, this causes the `sys` library to no longer be
1438-
# available. The stack overflow also goes on to suggest that
1439-
# it's not wise to use the __del__() as a destructor
1440-
# which is the case here.
1441-
1442-
# https://stackoverflow.com/questions/67218341/\
1443-
# modulenotfounderror-import-of-time-halted-none-in-sys-\
1444-
# modules-occured-when-obj?noredirect=1&lq=1
1445-
#
1446-
#
1447-
# Also see: https://stackoverflow.com/questions\
1448-
# /1481488/what-is-the-del-method-and-how-do-i-call-it
1449-
1450-
# At this time it seems clean to try to log out (if we can)
1451-
# but not throw any unnecessary exceptions (like this one) to
1452-
# the end user if we don't have to.
1453-
pass
1411+
self._logout()
14541412

14551413
@property
14561414
def url_identifier(self):

0 commit comments

Comments
 (0)