| 1 | [global] |
| 2 | alwayscopy = True |
| 3 | |
| 4 | [gh] |
| 5 | use_discover = False |
| 6 | |
| 7 | [tox] |
| 8 | envlist = |
| 9 | clean |
| 10 | validate |
| 11 | i18n |
| 12 | compile |
| 13 | minimal |
| 14 | release |
| 15 | |
| 16 | minversion = 4.0 |
| 17 | requires = virtualenv>=20.0.0 |
| 18 | isolated_build = True |
| 19 | |
| 20 | [testenv] |
| 21 | skip_install = false |
| 22 | usedevelop = true |
| 23 | changedir = {toxinidir} |
| 24 | allowlist_externals = * |
| 25 | ensurepip = true |
| 26 | setenv = |
| 27 | COVERAGE_RCFILE = {toxinidir}/pyproject.toml |
| 28 | |
| 29 | [testenv:build-src-rpm] |
| 30 | description = Build source RPM and place .src.rpm in dist/ |
| 31 | skip_install = true |
| 32 | allowlist_externals = |
| 33 | bash |
| 34 | cp |
| 35 | mkdir |
| 36 | find |
| 37 | rpmbuild |
| 38 | setenv = |
| 39 | HOME = {envtmpdir} |
| 40 | RPMTOP = {envtmpdir}/rpmbuild |
| 41 | commands_pre = |
| 42 | mkdir -p {envtmpdir}/rpmbuild/SOURCES |
| 43 | mkdir -p {envtmpdir}/rpmbuild/SPECS |
| 44 | mkdir -p dist/rpm |
| 45 | cp packaging/man/apprise.1 {envtmpdir}/rpmbuild/SOURCES/ |
| 46 | cp packaging/redhat/python-apprise.spec {envtmpdir}/rpmbuild/SPECS/ |
| 47 | find packaging/redhat/ -iname '*.patch' -exec cp {} {envtmpdir}/rpmbuild/SOURCES/ \; |
| 48 | bash -c 'cp dist/*.tar.gz {envtmpdir}/rpmbuild/SOURCES/' |
| 49 | bash -c 'echo "%_topdir {envtmpdir}/rpmbuild" > {envtmpdir}/.rpmmacros' |
| 50 | commands = |
| 51 | rpmbuild --nodeps -bs {envtmpdir}/rpmbuild/SPECS/python-apprise.spec |
| 52 | find {envtmpdir}/rpmbuild/SRPMS -name '*.src.rpm' -exec mv {} dist/rpm \; |
| 53 | |
| 54 | [testenv:build-el9-rpm] |
| 55 | description = Run RPM packaging for EPEL9 via Docker |
| 56 | skip_install = true |
| 57 | allowlist_externals = |
| 58 | docker |
| 59 | commands = |
| 60 | docker compose run --rm rpmbuild.el9 bash /apprise/bin/build-rpm.sh |
| 61 | |
| 62 | [testenv:build-el10-rpm] |
| 63 | description = Run RPM packaging for EPEL10 via Docker |
| 64 | skip_install = true |
| 65 | allowlist_externals = |
| 66 | docker |
| 67 | commands = |
| 68 | docker compose run --rm rpmbuild.el10 bash /apprise/bin/build-rpm.sh |
| 69 | |
| 70 | [testenv:build-f44-rpm] |
| 71 | description = Run RPM packaging for Fedora 44 via Docker |
| 72 | skip_install = true |
| 73 | allowlist_externals = |
| 74 | docker |
| 75 | commands = |
| 76 | docker compose run --rm rpmbuild.f44 bash /apprise/bin/build-rpm.sh |
| 77 | |
| 78 | [testenv:build-rawhide-rpm] |
| 79 | description = Run RPM packaging for Fedora Rawhide via Docker |
| 80 | skip_install = true |
| 81 | allowlist_externals = |
| 82 | docker |
| 83 | commands = |
| 84 | docker compose run --rm rpmbuild.rawhide bash /apprise/bin/build-rpm.sh |
| 85 | |
| 86 | [testenv:lint] |
| 87 | description = Check for lint violations and code style issues (read-only) |
| 88 | deps = ruff==0.15.8 |
| 89 | commands = |
| 90 | ruff check . {posargs} |
| 91 | ruff format --check . |
| 92 | |
| 93 | [testenv:format] |
| 94 | description = Auto-fix lint violations and apply consistent code style |
| 95 | deps = ruff==0.15.8 |
| 96 | commands = |
| 97 | ruff check . --fix {posargs} |
| 98 | ruff format . |
| 99 | |
| 100 | # - This defines a CLI script entry point for packaging. |
| 101 | # - It ensures that pip install . or python -m build includes |
| 102 | # a working apprise command. |
| 103 | # - This is required for proper packaging and end-user usage |
| 104 | [project.scripts] |
| 105 | apprise = "apprise.cli:main" |
| 106 | |
| 107 | [testenv:shell] |
| 108 | description = Obtain a shell with the apprise library in it's path |
| 109 | extras = dev,all-plugins |
| 110 | commands = |
| 111 | pip install --no-cache-dir -e ".[dev,all-plugins]" |
| 112 | python {posargs} |
| 113 | |
| 114 | [testenv:apprise] |
| 115 | description = Run Apprise CLI with args |
| 116 | extras = all-plugins |
| 117 | commands = |
| 118 | apprise {posargs} |
| 119 | |
| 120 | [testenv:cli] |
| 121 | description = Sanity-check Apprise CLI invocation |
| 122 | commands = |
| 123 | apprise --version |
| 124 | |
| 125 | [testenv:checkdone] |
| 126 | description = Lint + full test run to ensure PR readiness |
| 127 | extras = dev,all-plugins |
| 128 | commands = |
| 129 | pip install --no-cache-dir -e ".[dev,all-plugins]" |
| 130 | ruff check . |
| 131 | ruff format --check . |
| 132 | coverage run --source=apprise -m pytest tests {posargs} |
| 133 | coverage report |
| 134 | |
| 135 | [testenv:qa] |
| 136 | description = Full tests with all plugins + code coverage |
| 137 | extras = dev,all-plugins |
| 138 | commands = |
| 139 | pip install --no-cache-dir -e ".[dev,all-plugins]" |
| 140 | coverage erase |
| 141 | coverage run --source=apprise -m pytest tests {posargs} |
| 142 | coverage report -m |
| 143 | coverage xml -o coverage.xml |
| 144 | |
| 145 | [testenv:minimal] |
| 146 | description = Minimal dependencies + code coverage |
| 147 | extras = dev |
| 148 | commands = |
| 149 | pip install --no-cache-dir -e ".[dev]" |
| 150 | coverage erase |
| 151 | coverage run --source=apprise -m pytest tests {posargs} |
| 152 | coverage report -m |
| 153 | coverage xml -o coverage.xml |
| 154 | |
| 155 | [testenv:test] |
| 156 | description = Run simplified tests without coverage |
| 157 | extras = dev,all-plugins |
| 158 | commands = |
| 159 | pip install --no-cache-dir -e ".[dev,all-plugins]" |
| 160 | pytest --tb=short -q {posargs} |
| 161 | |
| 162 | [testenv:clean] |
| 163 | description = Remove build artifacts and cache files |
| 164 | skip_install = true |
| 165 | allowlist_externals = |
| 166 | find |
| 167 | rm |
| 168 | commands = |
| 169 | find . -type f -name "*.pyc" -delete |
| 170 | find . -type f -name "*.pyo" -delete |
| 171 | find . -type f -name "*.orig" -delete |
| 172 | find ./apprise/i18n -type f -name "*.mo" -delete |
| 173 | rm -rf BUILD SOURCES SRPMS BUILDROOT .cache .ruff_cache .coverage-reports .coverage coverage.xml dist build apprise.egg-info .mypy_cache .pytest_cache "__pycache__" |
| 174 | find . -type d -name "__pycache__" -delete |
| 175 | |
| 176 | [testenv:i18n] |
| 177 | platform = linux|darwin |
| 178 | description = Extract and update .pot/.po files for translation |
| 179 | extras = dev |
| 180 | deps = Babel |
| 181 | ensurepip = true |
| 182 | commands = |
| 183 | mkdir -p apprise/i18n |
| 184 | pybabel extract -F babel.cfg -o apprise/i18n/apprise.pot apprise |
| 185 | pybabel update --domain=apprise -i apprise/i18n/apprise.pot -d apprise/i18n |
| 186 | sh packaging/i18n_normalize.sh |
| 187 | |
| 188 | [testenv:compile] |
| 189 | description = Compile .mo files |
| 190 | deps = Babel |
| 191 | commands = |
| 192 | pybabel compile --domain=apprise -d apprise/i18n |
| 193 | |
| 194 | [testenv:build] |
| 195 | description = Build sdist and wheel (assumes translations compiled) |
| 196 | deps = |
| 197 | build |
| 198 | commands = |
| 199 | python -m build |
| 200 | |
| 201 | [testenv:build-sdist] |
| 202 | deps = build |
| 203 | commands = python -m build --sdist |
| 204 | |
| 205 | [testenv:build-wheel] |
| 206 | deps = build |
| 207 | commands = python -m build --wheel |
| 208 | |
| 209 | [testenv:validate] |
| 210 | description = Validate pyproject.toml against PEP 621/508 |
| 211 | deps = |
| 212 | rpmlint |
| 213 | validate-pyproject |
| 214 | packaging |
| 215 | commands = |
| 216 | validate-pyproject pyproject.toml |
| 217 | rpmlint packaging/redhat/python-apprise.spec |
| 218 | |
| 219 | [testenv:twine-check] |
| 220 | description = Run twine check on dist artifacts |
| 221 | deps = twine |
| 222 | commands = |
| 223 | python -m twine check dist/*.whl dist/*.tar.gz |
| 224 | |
| 225 | [testenv:man] |
| 226 | description = Rebuild the Apprise man page |
| 227 | allowlist_externals = docker |
| 228 | commands = |
| 229 | docker compose run --rm rpmbuild.el10 ronn \ |
| 230 | --organization="Chris Caron <[email protected]>" \ |
| 231 | packaging/man/apprise.md |
| 232 | |
| 233 | [testenv:release] |
| 234 | description = Prepare translations, compile, and build all artifacts |
| 235 | deps = |
| 236 | validate-pyproject |
| 237 | packaging |
| 238 | Babel |
| 239 | build |
| 240 | twine |
| 241 | commands = |
| 242 | tox -e clean |
| 243 | tox -e validate |
| 244 | tox -e i18n |
| 245 | tox -e compile |
| 246 | tox -e man |
| 247 | tox -e build |
| 248 | tox -e build-src-rpm |
| 249 | tox -e twine-check |