Debian Codegraph @

tox.ini

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