-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
127 lines (114 loc) · 3.64 KB
/
Copy pathpyproject.toml
File metadata and controls
127 lines (114 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "wirebench"
version = "0.1.0"
description = "A Python framework for modelling real electronic circuits with physical fidelity."
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE" }
dependencies = [
"networkx>=3.0",
"pydantic>=2.6",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-cov>=7.0",
"coverage[toml]>=7.0",
"mutmut>=3.0",
"hypothesis>=6.0",
"mypy>=1.10",
]
[project.scripts]
wirebench = "cli.main:main"
[tool.hatch.build.targets.wheel]
packages = ["src/framework", "src/components", "src/wirebench", "src/cli"]
[tool.hatch.build.targets.sdist]
include = [
"src/framework",
"src/components",
"src/wirebench",
"src/cli",
"README.md",
"LICENSE",
"pyproject.toml",
]
[tool.pytest.ini_options]
pythonpath = ["src", "demos", "tests/framework"]
testpaths = ["tests"]
# Coverage is NOT in addopts: pytest-cov + mutmut don't co-exist
# (mutmut's in-process pytest.main() exits 4 silently when pytest-cov
# is auto-enabled). Use `scripts/cov.sh` to run with coverage; plain
# `pytest` is the fast feedback loop.
[tool.coverage.run]
source = ["src"]
branch = true
omit = [
"src/applications/*",
"src/cli/*",
"src/demos/*",
]
[tool.coverage.report]
fail_under = 90
show_missing = true
skip_covered = false
# Lines genuinely uncoverable by tests (abstract methods, defensive
# unreachable defaults). Real gaps must be fixed, not pragma'd away.
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod",
"\\.\\.\\.$",
]
# Lines whose fall-through is the only possible branch (no real
# conditional). Coverage.py records the not-taken fall-through as a
# missed branch even though it can't actually be taken.
partial_branches = [
"pragma: no branch",
# Pydantic discriminator-record class declarations — long runs of
# `class XxxRecord(_YyyRecord):` definitions in format_records.py.
"^class [A-Z][A-Za-z0-9_]*Record\\(",
# Bare `type: Literal[...]` field declarations on those records.
"^\\s+type:\\s+Literal\\[",
# Single-line `def ...: return ...` (renderer stubs, unit dunder
# arithmetic, etc.). Coverage records the def→next-line fall-
# through as a branch even when the def body is unconditional.
"^\\s*def [a-zA-Z_][a-zA-Z0-9_]*\\(.*\\)(\\s*->\\s*[^:]+)?\\s*:\\s*return\\s",
]
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.xml]
output = "coverage.xml"
[tool.mutmut]
# Mutation testing — restricted to the framework. Components are
# mostly data-driven (pin tables, refdes prefixes) where mutating a
# constant doesn't reveal a real bug; mutmut runs there are noise.
# The framework's logical-net walker, ERC rules, validators, and
# registry dispatch are where mutation testing earns its keep.
paths_to_mutate = ["src/framework/"]
tests_dir = ["tests/"]
# Fast pytest invocation per mutant: --no-cov skips coverage overhead
# (mutmut measures kills, not lines), -x stops at first failure
# (a kill), -q quiets pytest output.
# Demos are imported by conftest (water_alarm + water_alarm_split);
# mutmut must include them in the mutants/ workspace.
# Demos + non-mutated src dirs must accompany mutants/ so the test
# suite's imports resolve. mutmut only auto-copies paths_to_mutate;
# the rest of src/ and demos/ ride along verbatim.
also_copy = [
"demos/",
"src/components/",
"src/applications/",
"src/cli/",
]
[tool.mypy]
mypy_path = ["src", "demos"]
strict = true
[dependency-groups]
dev = [
"pyright>=1.1.409",
"ruff>=0.15.13",
]