Do not build notebooks when doing linkcheck#272
Conversation
| commands = python -m sphinx -W -j2 -v -b html -d {toxworkdir}/docs_doctrees docs html | ||
| python -m sphinx -W -j2 -v -b doctest -d {toxworkdir}/docs_doctrees docs html | ||
| python -m sphinx -W -j2 -v -b doctest -d {toxworkdir}/docs_doctrees -D nbsphinx_execute=never docs html |
There was a problem hiding this comment.
This is doctest, linkcheck is 15 lines lower down, did you edit the wrong one or is the PR title wrong?
There was a problem hiding this comment.
Yes, I meant to edit the linkcheck line.
However, can we also skip building when doing doctest? Do I remember correctly that doctest is testing snippets in the docs, but not what is run in notebook cells?
There was a problem hiding this comment.
@jl-wynen do you know if not running notebooks for doctest is ok?
There was a problem hiding this comment.
Doesn't it use the cached results anyway since we build the docs in the line above?
I would think that we don't need to execute notebooks for doctest because we don't have code samples in the notebooks. But we do need to execute them for linkcheck so we can check the links in notebooks. Would be nice if we could reuse the cached results from the docs build in that case.
There was a problem hiding this comment.
Why do we need to run the notebooks just to check links in the markdown cells?
There was a problem hiding this comment.
I don't think linkcheck can handle markdown or notebooks on its own. AFAIK, it operates on the parse tree generated by docutils which require rst.
There was a problem hiding this comment.
nbsphinx will still render rst files from the notebooks, it just won't execute the code in the cells (so there will be no outputs in the generated docs).
To prove it, I tried to insert a bad link in one of the notebooks in essdiffraction and it found it:
(user-guide/dream/dream-advanced-powder-reduction: line 12) broken https://scipppp.github.io/ - 404 Client Error: Not Found for url: https://scipppp.github.io/
|
Did you also try whether doctest still works like this? |
I don't think we have tests in notebooks, so I don't see why it wouldn't? The tests still run in |

This saves quite a lot of build time.