Development Guidelines
Todo
This whole section needs to be written. The general gist is:
We use PDM at the package manager/virtual env for isolation.
pdm testfor Pytest,pdm docfor Sphinx, etc.
We also use PDM’s build backend as the build system, but this can be interfaced to via
pip.We use
pytest’sPytesterplugin to test our plugin.See
[tool.pytest.ini_options]forpytestconfig required for tests to function properly (includingdoctests).Doctests that are not intended to be invoked via
pytestare nominally run throughpytest-sphinx.pdm doc-test, which callssphinx-build -b doctest, is provided as a fallback in casepytest-sphinxmisses a doctest.
AFAICT, it is not possible to invoke
Pytesterthrough doctest, so all Python code in docs and intended to be invoked via pytest is duplicated intest_inject.py, and run as part of the mainpytestsuite (test_inject_sim_args).
Linting is done with a combination of
ruff,pydoclint, and transitively,flake8.flake8usage is minimized topydoclintand lints that are unstable inruff. See.flake8file (flake8doesn’t supportpyproject.toml).Eventually, this should go down to only
ruff, when thepydoclintfunctionality and extraflake8lints are stabilized. See[tool.ruff]section inpyproject.tomland compare to.flake8; lint rule overlap should be minimized.
Docs are written in Markdown using
mystwhen possible.