mirror of
https://github.com/ankitects/anki.git
synced 2026-05-16 10:21:08 -04:00
## Linked issue Closes #4838 ## Summary/motivation Adds `coverage.py`-based test coverage for both Python test suites (`pylib` and `qt`). Introduces `just test-py --coverage` and `just test-py --coverage --html`, plus the `just test --coverage`. Coverage reports are written to `out/coverage/`. ## How to test ```sh # Existing behavior unchanged just test-py # Terminal summary + enforces thresholds just test-py --coverage # Terminal summary + HTML reports under out/coverage/ just test-py --coverage --html # Umbrella (Python only for now) just test --coverage just test --coverage --html ``` ### Checklist (minimum) - [x] I ran `./ninja check` or an equivalent relevant check locally. ### Details - `coverage` dependency pinned to >=7.13.5 in pyproject.toml. - The `coverage` umbrella recipe currently delegates to Python only for now ## Before / after behavior Before: no `just test-py`, no coverage support. After: `just test-py` runs Python tests via ninja; `just test-py --coverage` runs them with `coverage.py` and enforces minimum line coverage. --------- Co-authored-by: Abdo <abdo@abdnh.net>
55 lines
1.2 KiB
TOML
55 lines
1.2 KiB
TOML
[project]
|
|
name = "anki-dev"
|
|
version = "0.0.0"
|
|
description = "Local-only environment"
|
|
requires-python = ">=3.12"
|
|
classifiers = ["Private :: Do Not Upload"]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pre-commit",
|
|
"mypy",
|
|
"mypy-protobuf",
|
|
"ruff",
|
|
"pytest",
|
|
"PyChromeDevTools",
|
|
"wheel",
|
|
"hatchling", # for type checking hatch_build.py files
|
|
"mock",
|
|
"types-protobuf",
|
|
"types-requests",
|
|
"types-orjson",
|
|
"types-decorator",
|
|
"types-flask",
|
|
"types-flask-cors",
|
|
"types-markdown",
|
|
"types-waitress",
|
|
"types-pywin32",
|
|
"briefcase>=0.4.2",
|
|
"coverage>=7.13.5",
|
|
]
|
|
docs = [
|
|
"sphinx",
|
|
"myst-parser",
|
|
"sphinx-book-theme",
|
|
"sphinx-autoapi",
|
|
"sphinx-autobuild>=2024.10.3",
|
|
"click-extra[sphinx]", # for GitHub alerts
|
|
"sphinxcontrib-mermaid>=2.0.2",
|
|
]
|
|
|
|
# Local resolution guard; keep in sync with Dependabot cooldown.
|
|
[tool.uv]
|
|
exclude-newer = "7 days"
|
|
exclude-newer-package = { anki-mac-helper = false, anki-audio = false, briefcase = false }
|
|
required-version = ">=0.9.25"
|
|
|
|
[tool.uv.workspace]
|
|
members = ["pylib", "qt", "qt/installer/briefcase_plugins"]
|
|
|
|
[[tool.uv.index]]
|
|
name = "testpypi"
|
|
url = "https://test.pypi.org/simple/"
|
|
publish-url = "https://test.pypi.org/legacy/"
|
|
explicit = true
|