apprise/bin
Chris Caron 8e1dad9f79
Minor typos and fixes (#1357)
* added forgotten persistent storage setting on email
* improved handling of default image
* function wording fix
* webexteams to support token= parameter arg
2025-07-29 12:17:55 -04:00
..
README.md Minor typos and fixes (#1357) 2025-07-29 12:17:55 -04:00
apprise Apprise Build System Modernization (PEP 621 / RPM CI) (#1368) 2025-07-28 19:49:53 -04:00
build-rpm.sh Apprise Build System Modernization (PEP 621 / RPM CI) (#1368) 2025-07-28 19:49:53 -04:00
checkdone.sh Minor typos and fixes (#1357) 2025-07-29 12:17:55 -04:00
test.sh Apprise Build System Modernization (PEP 621 / RPM CI) (#1368) 2025-07-28 19:49:53 -04:00

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.


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:

  1. bin/test.sh: runs the full test suite (same as tox -e qa) but without coveage
  2. bin/checkdone.sh: runs the full test suite (same as tox -e qa)
  3. bin/apprise: launches the Apprise CLI using the local build (same as tox -e apprise)
  4. ruff check . --fix: auto-formats the codebase (same as tox -e format)
  5. ruff check .: performs lint-only validation (same as tox -e lint)
  6. 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 the AppriseURLTester pattern.
  • All new plugins must include test coverage and pass linting.