From ccb2b6fbdc29bf84004b1cb729661e9266e4e25d Mon Sep 17 00:00:00 2001 From: WorldTeacher Date: Wed, 10 Dec 2025 10:43:38 +0100 Subject: [PATCH] chore(test): unify configs into pyproject.toml --- .coveragerc | 7 ------ pyproject.toml | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 7 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 120d0b8..0000000 --- a/.coveragerc +++ /dev/null @@ -1,7 +0,0 @@ -[run] -branch = True -omit = */build/*,tests/*,main.py -[report] -exclude_lines = - pragma: no cover - raise NotImplementedError.* diff --git a/pyproject.toml b/pyproject.toml index 9ea1281..550e45b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,3 +71,67 @@ markers = [ "integration: marks tests as integration tests (deselect with '-m \"not integration\"')", ] +[tool.coverage.run] +source = ["src"] +branch = true +omit = [ + "*/tests/*", + "*/test_*.py", + "*/__pycache__/*", + "*/.venv/*", + "*/site-packages/*", + "test.py", +] + +[tool.coverage.report] +precision = 2 +show_missing = true +skip_covered = false +exclude_lines = [ + "pragma: no cover", + "def __repr__", + "raise AssertionError", + "raise NotImplementedError", + "if __name__ == .__main__.", + "if TYPE_CHECKING:", + "@abstractmethod", + "@abc.abstractmethod", +] + +[tool.coverage.html] +directory = "htmlcov" + +[tool.mypy] +python_version = "3.13" +warn_return_any = true +warn_unused_configs = true +disallow_untyped_defs = false +disallow_incomplete_defs = false +check_untyped_defs = true +no_implicit_optional = true +warn_redundant_casts = true +warn_unused_ignores = true +warn_no_return = true +strict_equality = true + +[[tool.mypy.overrides]] +module = "tests.*" +ignore_errors = true + +[[tool.mypy.overrides]] +module = [ + "regex.*", + "requests.*", + "bs4.*", + "ratelimit.*", + "pytest.*", + "pytest_mock.*", + "bibapi._transformers", + "bibapi.webrequest", + "bibapi.catalogue", + "bibapi.lehmanns", + "bibapi.schemas.bookdata", + "bibapi.sru", +] +ignore_missing_imports = true +ignore_errors = true