@@ -171,6 +171,7 @@ namespaces = true
171171log_cli = true
172172log_level = " DEBUG"
173173timeout = 300
174+ addopts = [" --max-worker-restart=0" ]
174175testpaths = [" src/birdnet_tests" ]
175176norecursedirs = [" src/birdnet_v1_tests" ]
176177markers = [
@@ -209,39 +210,62 @@ select = [
209210[tool .ruff .lint .isort ]
210211known-first-party = [" birdnet*" ]
211212
213+ [tool .coverage .run ]
214+ branch = true
215+ source = [" src/birdnet" ]
216+ parallel = true
217+
218+ [tool .coverage .report ]
219+ show_missing = true
220+ exclude_lines = [" if __name__ == .__main__.:" ]
221+
212222[tool .tox ]
213223legacy_tox_ini = """
214224[tox]
215- envlist = py{311,312,313}, py{312} -repro
225+ envlist = py{311,312,313}, py312 -repro
216226isolated_build = True
217227
218228[testenv]
219- setenv =
220- COVERAGE_FILE = .coverage.{envname}
221229package = wheel
222230allowlist_externals = uv
223231install_command = uv pip install {opts} {packages}
232+ skip_missing_interpreters = true
224233
225234deps =
226235 .[tests,and-cuda]
227236commands =
228237 # ruff check src/birdnet
229238 # ruff check src/birdnet_tests
230- pytest -m "not repro and load_model" -n auto --max-worker-restart=0
231- pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto --max-worker-restart=0
232- pytest -m "not repro and not load_model and litert" -n auto --max-worker-restart=0
233- pytest -m "not repro and not load_model and gpu" -n 1 --max-worker-restart=0
239+ pytest -m "not repro and load_model" -n auto
240+ pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto
241+ pytest -m "not repro and not load_model and litert" -n auto
242+ pytest -m "not repro and not load_model and gpu" -n 1
243+ python -m build -o dist/
244+ python -m twine check dist/*
234245
235246[testenv:py312-repro]
236247deps =
237248 .[tests,repro]
238249commands =
239- pytest -m "load_model" -n auto --max-worker-restart=0
250+ pytest -m "load_model" -n auto
240251 # run normal tests including repro tests
241- pytest -m "not load_model and (not litert and not gpu)" -n auto --max-worker-restart=0
252+ pytest -m "not load_model and (not litert and not gpu)" -n auto
242253 # run litert tests including repro tests
243- pytest -m "not load_model and litert" -n auto --max-worker-restart=0
254+ pytest -m "not load_model and litert" -n auto
244255 # gpu tests are not supported to be run with repro environment
256+ python -m build -o dist/
257+ python -m twine check dist/*
258+
259+ [testenv:py312-coverage]
260+ deps =
261+ .[tests]
262+ commands =
263+ coverage erase
264+ pytest -m "not repro and load_model" -n auto --cov=src/birdnet --cov-append --cov-report=
265+ pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto --cov=src/birdnet --cov-append --cov-report=
266+ pytest -m "not repro and not load_model and litert" -n auto --cov=src/birdnet --cov-append --cov-report=
267+ pytest -m "not repro and not load_model and gpu" -n 1 --cov=src/birdnet --cov-append --cov-report=
268+ coverage report
245269"""
246270
247271[build-system ]
0 commit comments