Don't fail documentation build on examples exceptions
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Sat, 4 Feb 2023 20:49:19 +0000 (20:49 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sat, 4 Feb 2023 20:49:19 +0000 (20:49 +0000)
If example code outputs an error when run,
ipython (ipython:: blocks) now fails the whole build by default,
and tools/nbgenerate.py (.ipynb files) now leaves out that file
(leaving a broken link in the examples index).

As some examples use downloaded data and are hence expected to be
unrunnable on a Debian buildd, this instead keeps them
(::ipython with error output, .ipynb without output).

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: not-needed

Gbp-Pq: Name sphinx_ignore_errors.patch

docs/Makefile
docs/source/conf.py

index a77686dcd10e7f30df9933b6d8772f4478d1e934..328d5ee77b3a0d274a902408bd79f1dd45f10149 100644 (file)
@@ -34,6 +34,8 @@ html:
        mkdir -p $(BUILDDIR)/source/examples/notebooks/generated
        # Black list notebooks from doc build here
        $(TOOLSPATH)$(NOTEBOOKBUILD) --parallel --report-errors --skip-existing --execute-only --execution-blacklist statespace_custom_models
+       @echo "Copying notebooks that failed execution (there are usually several in Debian because some need network and/or dependencies we don't have)"
+       cp -nav ../examples/notebooks/*.ipynb -t source/examples/notebooks/generated
        @echo "Running sphinx-build"
        @echo @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(O)
        @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(O)
index e44ee7858d7e809b6dd0ded98375c2eede1b0527..fd2fdae67488fb60a880c1c08f7e4e12518724a1 100644 (file)
@@ -66,6 +66,7 @@ else:
 
 # nbsphinx options
 nbsphinx_allow_errors = True
+ipython_warning_is_error = False
 # sphinxcontrib-spelling options
 spelling_word_list_filename = ['spelling_wordlist.txt', 'names_wordlist.txt']
 spelling_ignore_pypi_package_names = True