![]() * added forgotten persistent storage setting on email * improved handling of default image * function wording fix * webexteams to support token= parameter arg |
||
---|---|---|
.. | ||
README.md | ||
apprise | ||
build-rpm.sh | ||
checkdone.sh | ||
test.sh |
README.md
๐ ๏ธ Apprise Development Guide
Welcome! This guide helps you contribute to Apprise with confidence. It outlines how to set up your local environment, run tests, lint your code, and build packages โ all using modern tools like Tox and Ruff.
๐ Getting Started
Set up your local development environment using Tox:
# Install Tox
python -m pip install tox
Tox manages dependencies, linting, testing, and builds โ no need to manually
install requirements-dev.txt
.
๐งช Running Tests
Use the qa
environment for full testing and plugin coverage:
tox -e qa
To focus on specific tests (e.g., email-related):
tox -e qa -- -k email
To run a minimal dependency test set:
tox -e minimal
๐งน Linting and Formatting
Apprise uses Ruff for linting and formatting.
This is configured via pyproject.toml
.
Run linting:
tox -e lint
Fix formatting automatically (where possible):
tox -e format
Linting runs automatically on all PRs that touch Python files via GitHub Actions and will fail builds on violation.
โ Pre-Commit Check (Recommended)
Before pushing or creating a PR, validate your work with:
tox -e lint,qa
Or use a combined check shortcut (if defined):
tox -e checkdone
This ensures your changes are linted, tested, and PR-ready.
๐จ CLI Testing
You can run the apprise
CLI using your local code without installation or run within docker containers:
# From the root of the repo
./bin/apprise -t "Title" -b "Body" mailto://user:pass@example.com
Alternatively you can continue to use the tox
environment:
# syntax tox -e apprise -- [options], e.g.:
tox -e apprise -- -vv -b "test body" -t "test title" mailto://credentials
Optionally, add the bin/apprise
to tests your changes
bin/apprise -vv -b "test body" -t "test title" <schema>
๐ฆ RPM Build & Verification
Apprise supports RPM packaging for Fedora and RHEL-based systems. Use Docker to safely test builds:
# Build RPM for EL9
docker-compose run --rm rpmbuild.el9 build-rpm.sh
# Build RPM for Fedora 42
docker-compose run --rm rpmbuild.f42 build-rpm.sh
๐ฆ Specific Environment Emulation
You can also emulate your own docker environment and just test/build inside that
# Python v3.9 Testing
docker-compose run --rm test.py39 bash
# Python v3.10 Testing
docker-compose run --rm test.py310 bash
# Python v3.11 Testing
docker-compose run --rm test.py311 bash
# Python v3.12 Testing
docker-compose run --rm test.py312 bash
Once you've entered one of these environments, you can leverage the following command to work with:
bin/test.sh
: runs the full test suite (same astox -e qa
) but without coveagebin/checkdone.sh
: runs the full test suite (same astox -e qa
)bin/apprise
: launches the Apprise CLI using the local build (same astox -e apprise
)ruff check . --fix
: auto-formats the codebase (same astox -e format
)ruff check .
: performs lint-only validation (same astox -e lint
)coverage run --source=apprise -m pytest tests
: manual test execution with coverage
The only advantage of this route is the overhead associated with each tox
call is gone (faster responses). Otherwise just utilizing the tox
commands can sometimes be easier.
๐งช GitHub Actions
GitHub Actions runs:
- โ Full test suite with coverage
- โ Linting (using Ruff)
- โ Packaging and validation
Linting must pass before PRs can be merged.
๐ง Developer Tips
- Add new plugins by following
demo.py
as a template. - Write unit tests under
tests/
using theAppriseURLTester
pattern. - All new plugins must include test coverage and pass linting.