bin/README.md
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.
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.
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
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.
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.
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:[email protected]
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>
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 /apprise/bin/build-rpm.sh
# Build RPM for EL10
docker-compose run --rm rpmbuild.el10 /apprise/bin/build-rpm.sh
# Build RPM for Fedora 42
docker-compose run --rm rpmbuild.f42 /apprise/bin/build-rpm.sh
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 as tox -e qa) but without coveagebin/checkdone.sh: runs the full test suite (same as tox -e qa)bin/apprise: launches the Apprise CLI using the local build (same as tox -e apprise)ruff check . --fix: auto-formats the codebase (same as tox -e format)ruff check .: performs lint-only validation (same as tox -e lint)coverage run --source=apprise -m pytest tests: manual test execution with coverageThe 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 runs:
Linting must pass before PRs can be merged.
demo.py as a template.tests/ using the AppriseURLTester pattern.