Skip to content

ci: execute the example scripts and tutorial pages - #54

Merged
HugoFara merged 1 commit into
mainfrom
ci/execute-docs
Sep 12, 2026
Merged

HugoFara merged 1 commit into
mainfrom
ci/execute-docs

Conversation

@HugoFara

Copy link
Copy Markdown
Owner

Summary

The harness that found the broken examples and tutorials this week, checked in and wired to CI so the docs cannot rot silently again.

  • tests/docs/test_examples.py: every docs/examples/*.py, run in a subprocess in a temp directory.
  • tests/docs/test_tutorials.py: every docs/source/tutorials/*.rst, its .. code-block:: python blocks concatenated in order into one script and run the same way — a page reads as a session, so every block must be real code.
  • Both run with matplotlib on Agg, PLOTLY_RENDERER=json, NUMBA_DISABLE_JIT=0 (the root conftest disables JIT for coverage) and PYTHONWARNINGS=error::DeprecationWarning:pylinkage: the docs must teach the current name.
  • Marked docs and deselected by default (addopts = "-v -m 'not docs'"): they take ~2½ minutes and need every optional backend. pytest tests/docs or pytest -m docs selects them.
  • notebooks.yml becomes Executable docs, keeping the execute job for the notebooks and adding examples-and-tutorials, which syncs --extra full --extra cad --extra analysis and runs pytest -m docs.

Verification

  • uv run --extra full --extra cad --extra analysis pytest -m docs: 23 passed, 1 skipped (index.rst has no code) in 140 s.
  • Default uv run pytest collects the same 2598 tests as before; the 24 new ones are deselected.
  • The new job on this PR is the first real run.

tests/docs runs every script under docs/examples/ and, for every page
under docs/source/tutorials/, its python code blocks concatenated in
order -- each in a subprocess with matplotlib on Agg, plotly rendering
to JSON and pylinkage DeprecationWarnings as errors. Four of the
examples and ten of the eleven tutorials had been broken for a release
without anything noticing; the notebooks were the only docs CI
executed.

The tests carry the docs marker and are deselected from the default
pytest run (two minutes and every optional backend). The Notebooks
workflow becomes Executable docs and gains a job that runs them with
the full, cad and analysis extras.
@HugoFara
HugoFara merged commit 12ac7fd into main Sep 12, 2026
10 checks passed
@HugoFara HugoFara mentioned this pull request Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant