executablebooks / MyST-NB

Parse and execute ipynb files in Sphinx
https://myst-nb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
206 stars 82 forks source link

nb_execution_show_tb seems to not do anything #482

Open basnijholt opened 1 year ago

basnijholt commented 1 year ago

Describe the bug

context When I set nb_execution_show_tb = True in my conf.py and my CI build fails, no exceptions are printed.

Possibly relevant packages installed by CI:

jupyter-cache/0.5/jupyter_cache-0.5.0-py3-none-any.whl (34 kB)
jupyter-client/8.1/jupyter_client-8.1.0-py3-none-any.whl (102 kB)
jupyter-core/5.3/jupyter_core-5.3.0-py3-none-any.whl (93 kB)
jupyter-events/0.6.3/jupyter_events-0.6.3-py3-none-any.whl (18 kB)
jupyter-server-terminals/0.4.4/jupyter_server_terminals-0.4.4-py3-none-any.whl (13 kB)
jupyter-server/2.5/jupyter_server-2.5.0-py3-none-any.whl (366 kB)
jupyterlab-pygments/0.2.2/jupyterlab_pygments-0.2.2-py2.py3-none-any.whl (21 kB)
jupyterlab-widgets/3.0.6/jupyterlab_widgets-3.0.6-py3-none-any.whl (198 kB)
jupytext/1.14.5/jupytext-1.14.5-py3-none-any.whl (298 kB)
myst-nb/0.17.1/myst_nb-0.17.1-py3-none-any.whl (78 kB)
myst-parser/0.18.1/myst_parser-0.18.1-py3-none-any.whl (58 kB)
notebook/6.5.2/notebook-6.5.2-py3-none-any.whl (439 kB)
notebook/6.5.3/notebook-6.5.3-py3-none-any.whl (529 kB)
sphinx-basic-ng/1b1/sphinx_basic_ng-1.0.0b1-py3-none-any.whl (22 kB)
sphinx/5.3/sphinx-5.3.0-py3-none-any.whl (3.2 MB)
sphinx/6.1.3/sphinx-6.1.3-py3-none-any.whl (3.0 MB)
sphinxcontrib-apidoc/0.2.1/sphinxcontrib_apidoc-0.2.1-py2.py3-none-any.whl (6.9 kB)
sphinxcontrib-apidoc/0.3/sphinxcontrib_apidoc-0.3.0-py2.py3-none-any.whl (8.5 kB)
sphinxcontrib-applehelp/1.0.4/sphinxcontrib_applehelp-1.0.4-py3-none-any.whl (120 kB)
sphinxcontrib-devhelp/1.0.2/sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl (84 kB)
sphinxcontrib-htmlhelp/2.0.1/sphinxcontrib_htmlhelp-2.0.1-py3-none-any.whl (99 kB)
sphinxcontrib-jsmath/1.0.1/sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl (5.1 kB)
sphinxcontrib-qthelp/1.0.3/sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl (90 kB)
sphinxcontrib-serializinghtml/1.1.5/sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl (94 kB)

Reproduce the bug

Make a failing .md file and observe the absence of exceptions in the logs.

List your environment

Can't run this in CI.

It is installing latest versions.

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

tillahoffmann commented 1 year ago

Is it possible that the traceback is not showing because nb_execution_raise_on_error = True (cf. #531)? A workaround for me has been to leave nb_execution_raise_on_error = False but invoke Sphinx with the -W flag which turns warnings into errors.

agoose77 commented 1 year ago

As discussed in https://github.com/executablebooks/MyST-NB/pull/531#issuecomment-1689623625, I think you just need to turn on nb_execution_raise_on_error, and run sphinx-build with -T in order for this to work. The nb_execution_show_tb option seems like a workaround for cases when we don't have access to sphinx-build arguments, in which case https://github.com/executablebooks/MyST-NB/issues/482#issuecomment-1684151372 is the appropriate usage.

However, #531 has merged, so in future nb_execution_raise_on_error should have no effect upon nb_execution_show_tb.