# Tool configuration only. The pinned versions live in requirements.txt (runtime) # and requirements-dev.txt (tests and checks); the code is run from src/ without # being installed. [tool.pytest.ini_options] pythonpath = ["src"] testpaths = ["tests"] addopts = "-ra --strict-markers" markers = [ "fasit: reproduces a published number with the source's own assumptions", ] [tool.mypy] strict = true mypy_path = "src" files = ["src", "tests"] python_version = "3.11" [tool.ruff] line-length = 100 target-version = "py311" src = ["src", "tests"] # Text files (sources, specification, pre-registration) are never touched by the formatter. extend-exclude = ["*.md"] [tool.ruff.lint] select = ["ALL"] ignore = [ # Formatter conflicts (ruff's own recommendation). "COM812", "ISC001", # Docstring style: Google convention is selected below; these two contradict it. "D203", "D213", # Argument and variable names follow the symbols of the specification # (P_u, KF, PUE, L_N, D_avv ...), so that every function can be read against # its equation. Lower-casing them would break that link. "N802", "N803", "N806", # One function per equation: an equation with twelve symbols has twelve arguments. "PLR0913", # The licence is stated once, in LICENSE; files carry no copyright header. "CPY001", ] # The parameter file writes "no unit" and ranges with an en dash; the code must match it. allowed-confusables = ["–"] [tool.ruff.lint.pydocstyle] convention = "google" [tool.ruff.lint.per-file-ignores] "tests/**" = [ "S101", # assert is what a test is "PLR2004", # published numbers are compared as literals, with the source next to them "INP001", # tests are not a package "D103", # the name of a test says what it tests "PLR0917", # helpers that mirror a source's table take its columns in order ]