Tooling settings¶
The pyproject.toml files carry no comments, so this page records the reason behind each setting that needs one.
- The basedpyright editor extension and the
basedpyrightCLI read the same[tool.basedpyright]table, so their results never diverge. extraPathsmakes basedpyright resolvefemforgefrom the source tree instead of the editable install, so its wildcard re-exports count as first-party.stubPathpoints basedpyright attypings/, which holds hand-written stubs for only the gmsh, lazy_loader, magpylib, trame, and winpty members that the code calls. When you call a new member of one of these libraries, add its signature totypings/, or the type check fails.reportUnnecessaryTypeIgnoreCommentflags any# pyright: ignorecomment that no longer suppresses a diagnostic, so every remaining ignore suppresses a real one.- The
reportUnknown*family andreportAnystay atwarning, because the scientific dependencies ship no stubs and the editor would otherwise mark their untyped values as errors. CI runsbasedpyright --warnings, which turns every warning into a failure. reportNoOverloadImplementation = "none"allows overloads without an implementation, because the scientific dependencies use multiple dispatch.- The
panelsexecution environment turns offreportMissingModuleSource, because the terminal panel importswinptyfrom pywinpty, the optional Windows-onlyptyextra of the workbench. On a host without the extra, such as CI, basedpyright finds only the stub. An inline ignore can't replace this setting, because the ignore becomes unnecessary on a host that has the extra. addoptsmakes everypytestrun enforce 100% line coverage oversrc. To run a subset without the coverage gate, pass--no-cov.- The coverage
sourceleaves out the workbench package, because behavior tests and a scripted browser run verify its panels. exclude_alsoleaves boilerplate, such asif TYPE_CHECKING:blocks and abstract methods, out of the coverage count. Lines that can't run without gmsh or Elmer carry# pragma: no cover, and the gated integration tests verify them on a machine that has both. As a result, the 100% gate measures every line of environment-independent logic.- The workbench pins
pyvista,vtk, andtrame-vtklocalto one minor version each, because a new minor can change what its VTK.wasm mirror draws. The VTK serializer and the wasm runtime thattrame-vtklocalfetches to match it decide what the browser renders, andpyvistadecides what a clip passes to them. - The workbench depends on
pyvista[colormaps], because most of the field viewer's colormap catalog resolves through cmocean, colorcet, and cmcrameri, which that extra installs. - The pre-commit hook runs the type and lint gates but not pytest, so commits stay fast. The Quality workflow runs the full suite with the coverage gate.
- The Quality workflow backstops the hooks, because
git commit --no-verifyskips them.