From a7f6539a8c6fbd053dcb65ebcbba75627788e5e5 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Sun, 5 Jul 2026 21:44:05 +0300 Subject: [PATCH 1/4] Port .coveragerc to pyproject.toml --- .coveragerc | 22 ---------------------- pyproject.toml | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 22 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 1f474015e30..00000000000 --- a/.coveragerc +++ /dev/null @@ -1,22 +0,0 @@ -# .coveragerc to control coverage.py - -[report] -# Regexes for lines to exclude from consideration -exclude_also = - # Don't complain if non-runnable code isn't run - if 0: - if __name__ == .__main__.: - # Don't complain about debug code - if DEBUG: - # Don't complain about compatibility code for missing optional dependencies - except ImportError - if TYPE_CHECKING: - @abc.abstractmethod - # Empty bodies in protocols or abstract methods - ^\s*def [a-zA-Z0-9_]+\(.*\)(\s*->.*)?:\s*\.\.\.(\s*#.*)?$ - ^\s*\.\.\.(\s*#.*)?$ - -[run] -omit = - checks/*.py - Tests/createfontdatachunk.py diff --git a/pyproject.toml b/pyproject.toml index a2366e717ff..46fdf00f502 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -204,3 +204,24 @@ addopts = [ "-ra", "--color=auto" ] testpaths = [ "Tests", ] + +[tool.coverage] +run.omit = [ + "checks/*.py", + "Tests/createfontdatachunk.py", +] +report.exclude_also = [ + "@abc.abstractmethod", + "^\\s*\\.\\.\\.(\\s*#.*)?$", + # Empty bodies in protocols or abstract methods + "^\\s*def [a-zA-Z0-9_]+\\(.*\\)(\\s*->.*)?:\\s*\\.\\.\\.(\\s*#.*)?$", + # Don't complain about compatibility code for missing optional dependencies + "except ImportError", + "if __name__ == .__main__.:", + # Don't complain if non-runnable code isn't run + "if 0:", + # Don't complain about debug code + "if DEBUG:", + # Don't complain about code that generally isn't run + "if TYPE_CHECKING:", +] From 0817f5d2829ebcac5cede979ddf03f327f14b601 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Sun, 5 Jul 2026 21:45:35 +0300 Subject: [PATCH 2/4] Omit benchmarks.py from coverage It isn't run under coverage testing in CI, so it gives false negatives --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 46fdf00f502..c8d23b391d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -208,6 +208,7 @@ testpaths = [ [tool.coverage] run.omit = [ "checks/*.py", + "Tests/benchmarks.py", "Tests/createfontdatachunk.py", ] report.exclude_also = [ From 533711585c871101f71e8c611efa658ae8c6e811 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Sun, 5 Jul 2026 23:55:23 +0300 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- pyproject.toml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c8d23b391d9..2bc5cf8312c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -206,6 +206,8 @@ testpaths = [ ] [tool.coverage] +run.core = "sysmon" # default for 3.14+, available for 3.12+ +run.disable_warnings = [ "no-sysmon" ] # 3.11 and earlier run.omit = [ "checks/*.py", "Tests/benchmarks.py", @@ -213,16 +215,11 @@ run.omit = [ ] report.exclude_also = [ "@abc.abstractmethod", - "^\\s*\\.\\.\\.(\\s*#.*)?$", # Empty bodies in protocols or abstract methods "^\\s*def [a-zA-Z0-9_]+\\(.*\\)(\\s*->.*)?:\\s*\\.\\.\\.(\\s*#.*)?$", # Don't complain about compatibility code for missing optional dependencies "except ImportError", "if __name__ == .__main__.:", - # Don't complain if non-runnable code isn't run - "if 0:", # Don't complain about debug code "if DEBUG:", - # Don't complain about code that generally isn't run - "if TYPE_CHECKING:", ] From 3b66f8c34d46b0d1916c07360f58c02a681aad09 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Mon, 6 Jul 2026 09:30:59 +0300 Subject: [PATCH 4/4] Update pyproject.toml Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2bc5cf8312c..970dbdef6de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -207,7 +207,7 @@ testpaths = [ [tool.coverage] run.core = "sysmon" # default for 3.14+, available for 3.12+ -run.disable_warnings = [ "no-sysmon" ] # 3.11 and earlier +run.disable_warnings = [ "no-sysmon" ] # 3.11 run.omit = [ "checks/*.py", "Tests/benchmarks.py",