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

Upgrading from 6.0.6 --> 6.0.7 appears to break nbsphinx usage #1442

Open
SimonBiggs opened this issue Oct 8, 2020 · 6 comments
Open

Upgrading from 6.0.6 --> 6.0.7 appears to break nbsphinx usage #1442

SimonBiggs opened this issue Oct 8, 2020 · 6 comments

Comments

@SimonBiggs
Copy link

SimonBiggs commented Oct 8, 2020

I use nbsphinx to use Notebooks within the documentation of the pymedphys library. For example:
https://docs.pymedphys.com/howto/gamma/effect-of-noise.html

When I upgrade 6.0.6 --> 6.0.7 I am now getting the following error message:

Notebook error:
TemplateNotFound in howto/gamma/effect-of-noise.ipynb:
rst.tpl
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/runner/work/pymedphys/pymedphys/pymedphys/cli/__init__.py", line 146, in pymedphys_cli
    args.func(args)
  File "/home/runner/work/pymedphys/pymedphys/pymedphys/_dev/docs.py", line 22, in build_docs
    shell=True,
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'poetry run sphinx-build -W /home/runner/work/pymedphys/pymedphys/docs /home/runner/work/pymedphys/pymedphys/docs/_build/html' returned non-zero exit status 2.

See https://github.com/pymedphys/pymedphys/runs/1224843568?check_suite_focus=true#step:31:28

The only difference between master and that branch is that the nbconvert pinning to 6.0.6 was removed:
https://github.com/pymedphys/pymedphys/pull/1087/files#r501560031

The notebook in question can be found at:
https://github.com/pymedphys/pymedphys/blob/master/docs/howto/gamma/effect-of-noise.ipynb

@MSeal
Copy link
Contributor

MSeal commented Oct 9, 2020

The rst.tpl filename was removed in 6.0.7. It was deprecated but we had to remove it earlier to fix a larger issue. The fix is to reference the rst template instead of the old file name, or if extending the rsp template inside jinja to extend index.rst.j2 and set the base template in your conf.json to be rst. See https://nbconvert.readthedocs.io/en/latest/customizing.html

@mgeier
Copy link
Contributor

mgeier commented Oct 9, 2020

This has been fixed some time ago (but apparently not permanently) by @takluyver in spatialaudio/nbsphinx#344.
Since then, rst.tpl isn't used in nbsphinx anymore. Instead, nbconvert.RSTExporter().template_file is used.
But it looks like this is somehow broken now ...

@MSeal
Copy link
Contributor

MSeal commented Oct 9, 2020

That's odd since that code should be picking up the correct filename...

In [1]: import nbconvert

In [2]: nbconvert.RSTExporter().template_file
Out[2]: 'index.rst.j2'

Do you have any custom config that references rst.tpl?

@mgeier
Copy link
Contributor

mgeier commented Oct 16, 2020

@SimonBiggs Any news?

@SimonBiggs
Copy link
Author

No usage of rst.tpl. See https://github.com/pymedphys/pymedphys/tree/master/docs for the docs build directory being used.

I am doing the following:
https://github.com/pymedphys/pymedphys/blob/47a5c3517b5e3240cf55db3f6bffa1ec7307631a/docs/conf.py#L109-L125

Might that be an issue?

@SnarkBoojum
Copy link

The docs/source/changelog.rst still references rst.tpl, so there's something amiss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants