Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using myst markdown notebooks and execute=="off" #152

Closed
choldgraf opened this issue Apr 16, 2020 · 1 comment · Fixed by #175
Closed

Error when using myst markdown notebooks and execute=="off" #152

choldgraf opened this issue Apr 16, 2020 · 1 comment · Fixed by #175
Labels
bug Something isn't working

Comments

@choldgraf
Copy link
Member

choldgraf commented Apr 16, 2020

If someone builds a Sphinx site with

  • MyST-nb installed
  • A MyST-markdown notebook
  • Sets jupyter_execute = "off"

Then we trigger a bug somewhere in jupyter_sphinx when the parsing happens. Here seem to be the relevant lines from the traceback I found:

  File "/c/Users/choldgraf/Dropbox/github/forks/python/ebp/myst-nb/myst_nb/parser.py", line 72, in parse
    path_doc = nb_output_to_disc(ntbk, document)
  File "/c/Users/choldgraf/Dropbox/github/forks/python/ebp/myst-nb/myst_nb/parser.py", line 291, in nb_output_to_disc
    write_notebook_output(ntbk, str(output_dir), doc_filename)
  File "/home/choldgraf/anaconda/envs/dev/lib/python3.8/site-packages/jupyter_sphinx/execute.py", line 259, in write_notebook_output
    ext = notebook.metadata.language_info.file_extension
  File "/home/choldgraf/anaconda/envs/dev/lib/python3.8/site-packages/ipython_genutils/ipstruct.py", line 134, in __getattr__
    raise AttributeError(key)
AttributeError: language_info

I think that it might make sense to not support this use-case, since it is strange to have a myst markdown notebook that doesn't get executed. But, perhaps we want to raise a warning instead of having this error show up.

@choldgraf choldgraf added the bug Something isn't working label Apr 16, 2020
@chrisjsewell
Copy link
Member

This is handled here when using the cache (and no cache match is found): https://github.com/ExecutableBookProject/MyST-NB/blob/b750c1aaefac83bf586da90809a485fa7fd09d30/myst_nb/cache.py#L185-L191

But yes it doesn't make much sense to be using the markdown notebooks with no execution or caching, so this should be warned or raised

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants