CLI tasks and pytest options¶
pybFoam uses poethepoet (poe) as a task runner. Tasks are defined in
pyproject.toml under [tool.poe.tasks].
poe tasks¶
Task |
Command |
Purpose |
|---|---|---|
|
|
Run the full test suite. Requires a sourced OpenFOAM environment and a built package. |
|
|
Lint with ruff (rules: E, F, I — pycodestyle, pyflakes, isort). |
|
|
Auto-format with ruff. |
|
|
Run mypy in strict mode with the pydantic plugin. Checks |
|
|
Build HTML docs into |
|
|
Open the locally-built docs in a browser. |
Invoke any task with poe <name>. Add flags after the name; they are
forwarded to the underlying command (e.g. poe test -k sampling).
Custom pytest options¶
Defined in the top-level conftest.py:
Option |
Default |
Effect |
|---|---|---|
|
|
Cap how many timesteps a test solver writes. Useful when iterating on
a test to avoid generating many result directories. |
|
(cleanup on) |
Skip the case teardown after a test finishes so you can inspect the
run directory. Tests set up their cases from |
Standard pytest options (-k, -x, -v, --lf, etc.) all work too.
[tool.pytest.ini_options] sets the default addopts = "-ra -v -s".
Stub generation¶
Type stubs for the compiled extension modules are generated by a separate script (not a poe task):
./scripts/generate_stubs.sh
This runs pybind11-stubgen, cleans and formats the output, copies the
.pyi files into src/pybFoam/, and verifies with mypy.