| 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 and style checks: |
| 14 |
```bash |
| 15 |
tox -e lint |
| 16 |
``` |
| 17 |
If it reports issues, auto-fix them with: |
| 18 |
```bash |
| 19 |
tox -e format |
| 20 |
``` |
| 21 |
|
| 22 |
- โ๏ธ Your changes are covered by tests: |
| 23 |
```bash |
| 24 |
tox -e qa |
| 25 |
``` |
| 26 |
|
| 27 |
|
| 28 |
- โ๏ธ You followed the plugin template (if adding a new plugin). |
| 29 |
- โ๏ธ A new or changed multi-target plugin records each success with |
| 30 |
`mark_delivered()`. |
| 31 |
- โ๏ธ You included inline docstrings and respected the BSD 2-Clause license. |
| 32 |
- โ๏ธ Your commit message is descriptive. |
| 33 |
|
| 34 |
--- |
| 35 |
|
| 36 |
## ๐ฆ Local Development Setup |
| 37 |
|
| 38 |
To get started with development: |
| 39 |
|
| 40 |
### ๐งฐ System Requirements |
| 41 |
|
| 42 |
- Python >= 3.9 |
| 43 |
- `pip` |
| 44 |
- `git` |
| 45 |
- Optional: `VS Code` with the Python extension |
| 46 |
|
| 47 |
### ๐ One-Time Setup |
| 48 |
|
| 49 |
```bash |
| 50 |
git clone https://github.com/caronc/apprise.git |
| 51 |
cd apprise |
| 52 |
|
| 53 |
# Install all runtime + dev dependencies |
| 54 |
pip install '.[dev]' |
| 55 |
``` |
| 56 |
|
| 57 |
(Optional, but recommended if actively developing): |
| 58 |
```bash |
| 59 |
pip install -e '.[dev]' |
| 60 |
``` |
| 61 |
|
| 62 |
If you use [uv](https://docs.astral.sh/uv/), one command sets up a `.venv` |
| 63 |
with every dev tool and plugin dependency: |
| 64 |
```bash |
| 65 |
uv sync |
| 66 |
uv run pytest |
| 67 |
``` |
| 68 |
|
| 69 |
`tox` also works through uv: |
| 70 |
```bash |
| 71 |
uvx --with tox-uv tox -e qa |
| 72 |
``` |
| 73 |
|
| 74 |
--- |
| 75 |
|
| 76 |
## ๐งช Running Tests |
| 77 |
|
| 78 |
```bash |
| 79 |
pytest # Run all tests |
| 80 |
pytest tests/foo.py # Run a specific test file |
| 81 |
``` |
| 82 |
|
| 83 |
Run with coverage: |
| 84 |
```bash |
| 85 |
pytest --cov=apprise --cov-report=term |
| 86 |
``` |
| 87 |
|
| 88 |
--- |
| 89 |
|
| 90 |
## ๐งน Linting & Formatting |
| 91 |
|
| 92 |
Use `tox` to run through the same toolchain as CI: |
| 93 |
|
| 94 |
```bash |
| 95 |
tox -e lint # Check for lint violations and style issues (read-only) |
| 96 |
tox -e format # Auto-fix lint violations and apply consistent code style |
| 97 |
``` |
| 98 |
|
| 99 |
If you prefer to call ruff directly: |
| 100 |
|
| 101 |
```bash |
| 102 |
ruff check . # Check lint violations |
| 103 |
ruff check . --fix # Auto-fix lint violations |
| 104 |
ruff format --check . # Check code style |
| 105 |
ruff format . # Apply code style |
| 106 |
``` |
| 107 |
|
| 108 |
--- |
| 109 |
|
| 110 |
## ๐ Translations |
| 111 |
|
| 112 |
Apprise presents its human readable strings (the names of the settings each |
| 113 |
service accepts) in the language of whoever is running it. Every language |
| 114 |
lives in its own directory under `apprise/i18n/`. |
| 115 |
|
| 116 |
Start by seeing where help is needed: |
| 117 |
|
| 118 |
```bash |
| 119 |
python packaging/i18n_status.py |
| 120 |
``` |
| 121 |
|
| 122 |
Each language is listed with how much of it is translated, followed by a |
| 123 |
bullet for every string still waiting on someone. The report also names the |
| 124 |
exact file to edit. |
| 125 |
|
| 126 |
To improve an existing translation: |
| 127 |
|
| 128 |
1. Open `apprise/i18n/<language>/LC_MESSAGES/apprise.po` for your language. |
| 129 |
2. Fill in the `msgstr ""` under each `msgid` you want to translate. Leave |
| 130 |
the `msgid` lines alone; they are the English source text. |
| 131 |
3. Remove any `#, fuzzy` comment once you have confirmed the translation |
| 132 |
below it. A fuzzy entry is a machine guess and Apprise ignores it. |
| 133 |
4. Rebuild and check your work: |
| 134 |
|
| 135 |
```bash |
| 136 |
tox -e i18n # refresh the .pot and every .po file |
| 137 |
tox -e compile # build the .mo files Apprise loads |
| 138 |
tox -e i18n-status # confirm nothing is left behind |
| 139 |
``` |
| 140 |
|
| 141 |
To start a brand new language, let Babel create the catalog for you so its |
| 142 |
header carries the right `Language`, `Language-Team`, and `Plural-Forms` |
| 143 |
values for that language: |
| 144 |
|
| 145 |
```bash |
| 146 |
tox -e i18n # build apprise/i18n/apprise.pot first |
| 147 |
pybabel init --domain=apprise -i apprise/i18n/apprise.pot \ |
| 148 |
-d apprise/i18n -l <language> |
| 149 |
``` |
| 150 |
|
| 151 |
Name the directory after the language code, such as `de` or `ja`. A region |
| 152 |
may be added when a language needs one (`pt_BR`), and Apprise falls back to |
| 153 |
the plain language when no catalog exists for the region. Then translate it |
| 154 |
the same way as above. |
| 155 |
|
| 156 |
Only text a person reads gets translated. Anything a program reads, such as |
| 157 |
a status code or a key in a JSON response, stays in English. |
| 158 |
|
| 159 |
--- |
| 160 |
|
| 161 |
## ๐งฐ Optional: Using VS Code |
| 162 |
|
| 163 |
1. Open the repo: `code .` |
| 164 |
2. Press `Ctrl+Shift+P -> Python: Select Interpreter` |
| 165 |
3. Choose the same interpreter you used for `pip install .[dev]` |
| 166 |
4. Press `Ctrl+Shift+P -> Python: Discover Tests` |
| 167 |
|
| 168 |
`.vscode/settings.json` is pre-configured with: |
| 169 |
|
| 170 |
- pytest as the test runner |
| 171 |
- ruff for linting |
| 172 |
- PYTHONPATH set to project root |
| 173 |
|
| 174 |
No `.venv` is required unless you choose to use one. |
| 175 |
|
| 176 |
--- |
| 177 |
|
| 178 |
## ๐ How to Contribute |
| 179 |
|
| 180 |
1. **Fork the repository** and create a new branch. |
| 181 |
2. Make your changes. |
| 182 |
3. Run the checks listed above. |
| 183 |
4. Submit a pull request (PR) to the `main` branch. |
| 184 |
|
| 185 |
GitHub Actions will run tests and lint checks on your PR automatically. |
| 186 |
|
| 187 |
--- |
| 188 |
|
| 189 |
## ๐งช Need Help with Testing or Plugins? |
| 190 |
|
| 191 |
See [DEVELOPMENT.md](./DEVELOPMENT.md) for: |
| 192 |
- Full setup instructions |
| 193 |
- Tox environment descriptions |
| 194 |
- RPM testing |
| 195 |
- Plugin development guidance |
| 196 |
|
| 197 |
--- |
| 198 |
|
| 199 |
## ๐ Thank You |
| 200 |
|
| 201 |
Your contributions make Apprise better for everyone โ thank you! |
| 202 |
|
| 203 |
๐ See [ACKNOWLEDGEMENTS.md](./ACKNOWLEDGEMENTS.md) for a list of contributors. |