-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
221 lines (205 loc) · 6.29 KB
/
pyproject.toml
File metadata and controls
221 lines (205 loc) · 6.29 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
[build-system]
requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"
[project]
name = "lineforge"
description = "Open-source MCP-enabled transmission line calculator (lineforge)"
readme = "README.md"
license = { text = "AGPL-3.0-or-later" }
requires-python = ">=3.11"
authors = [
{ name = "lineforge contributors" },
]
keywords = [
"transmission-line",
"impedance",
"microstrip",
"stripline",
"cpwg",
"pcb",
"rf",
"electromagnetics",
"mcp",
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
"Topic :: Scientific/Engineering :: Physics",
]
dynamic = ["version"]
dependencies = [
"numpy>=1.26",
"scipy>=1.13",
"pyamg>=5.1",
"pydantic>=2.7",
"pillow>=10.3",
"pint>=0.24",
"typer>=0.12",
"rich>=13.7",
"mcp>=1.0",
"anyio>=4.4",
"diskcache>=5.6",
]
[project.optional-dependencies]
dev = [
"pytest>=8.2",
"pytest-cov>=5.0",
"pytest-asyncio>=0.23",
"hypothesis>=6.100",
"ruff>=0.5",
"black>=24.4",
"mypy>=1.10",
"types-pillow",
"scikit-rf>=1.1",
"maturin>=1.7",
"mktestdocs>=0.2",
"httpx>=0.27",
]
docs = [
"mkdocs>=1.6",
"mkdocs-material>=9.5",
"mkdocstrings[python]>=0.25",
]
# Web GUI (FastAPI + Next.js front-end). Install with `pip install lineforge[gui]`
# then run `lineforge gui` to launch both servers. Frontend lives at
# <repo>/frontend/ and needs `pnpm install` separately.
gui = [
"fastapi>=0.115",
"uvicorn[standard]>=0.30",
"websockets>=12",
"python-dotenv>=1.0",
"claude-agent-sdk>=0.1.77",
"scikit-rf>=1.1",
]
[project.urls]
Homepage = "https://github.com/RFingAdam/lineforge"
Documentation = "https://lineforge.readthedocs.io"
Issues = "https://github.com/RFingAdam/lineforge/issues"
Source = "https://github.com/RFingAdam/lineforge"
[project.scripts]
lineforge = "lineforge.cli:app"
[tool.maturin]
module-name = "lineforge._kernel"
manifest-path = "crates/lineforge_kernel/Cargo.toml"
python-source = "src"
features = ["pyo3/extension-module"]
[tool.ruff]
target-version = "py311"
line-length = 100
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"N", # pep8-naming
"SIM", # flake8-simplify
"RUF", # ruff-specific
]
ignore = [
"E501", # line too long (handled by black)
"E702", # multiple statements on one line (we use this for compact array setup)
"N803", # argument name should be lowercase (we use W, H, T, S, etc., as physics dictates)
"N806", # variable name should be lowercase (same reason)
"N802", # function name should be lowercase (we use Z0, Zdiff, etc. for clarity)
"N815", # mixedCase class attribute — same reason (s11_dB, rl_target_dB, C_F, etc.)
"RUF001", # ambiguous unicode in identifier (we use Greek letters: δ, ε, μ, ω, etc.)
"RUF002", # ambiguous unicode in docstring (×, ², etc., are domain-correct)
"RUF003", # ambiguous unicode in comment (same)
"RUF100", # unused noqa (lint-rule moves between versions)
"BLE001", # blind except — sometimes unavoidable at API boundaries
"B008", # function call in default arg — Typer requires this pattern
"A002", # shadowing a builtin (id) — needed for MCP resource URIs
"ARG001", # unused function arg — common with explicit interface stubs
"SIM300", # Yoda conditions — sometimes clearer in physics code
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["B011"]
"src/lineforge/web/app.py" = ["E402"] # imports after function definition by design (claude-cli check)
"src/lineforge/web/api_field_plot.py" = ["RUF006"] # fire-and-forget background task is intentional
"examples/**/*.py" = [
"F401", # unused imports OK in examples
"F403", # star imports OK in examples
"E402", # late imports OK — examples often interleave code with closed-form refs
"E741", # ambiguous single-letter names OK in EM examples (I, l, etc., have physics meaning)
"N816", # mixedCase names OK in EM examples (g_T, r_T match formula symbols)
"B007", # unused loop variables OK in tutorial-style examples
]
[tool.black]
line-length = 100
target-version = ["py311", "py312", "py313"]
[tool.mypy]
python_version = "3.11"
strict = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_return_any = true
warn_unreachable = true
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = [
"pyamg.*",
"diskcache.*",
"skrf.*",
"scipy",
"scipy.*",
"lineforge._kernel",
]
ignore_missing_imports = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov-config=pyproject.toml",
]
asyncio_mode = "auto"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"atlc2_parity: tests that compare against published atlc2 values",
"needs_rust: tests that exercise the Rust kernel",
]
[tool.coverage.run]
source = ["src/lineforge"]
branch = true
omit = [
"*/tests/*",
"*/_kernel.pyi",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"@overload",
]
show_missing = true
# CLI commands and viewer are exercised in integration tests; this threshold
# guards regression in the core solvers + API surfaces.
fail_under = 75