Repository navigation
ci: execute the example scripts and tutorial pages - #54
Merged
Merged
Conversation
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.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: everydocs/examples/*.py, run in a subprocess in a temp directory.tests/docs/test_tutorials.py: everydocs/source/tutorials/*.rst, its.. code-block:: pythonblocks concatenated in order into one script and run the same way — a page reads as a session, so every block must be real code.PLOTLY_RENDERER=json,NUMBA_DISABLE_JIT=0(the root conftest disables JIT for coverage) andPYTHONWARNINGS=error::DeprecationWarning:pylinkage: the docs must teach the current name.docsand deselected by default (addopts = "-v -m 'not docs'"): they take ~2½ minutes and need every optional backend.pytest tests/docsorpytest -m docsselects them.notebooks.ymlbecomes Executable docs, keeping theexecutejob for the notebooks and addingexamples-and-tutorials, which syncs--extra full --extra cad --extra analysisand runspytest -m docs.Verification
uv run --extra full --extra cad --extra analysis pytest -m docs: 23 passed, 1 skipped (index.rsthas no code) in 140 s.uv run pytestcollects the same 2598 tests as before; the 24 new ones are deselected.