nbsphinx: Jinja2 update to version 3 breaks nbsphinx

As Jinja2 version is not frozen to 2.11 in setup.py nbsphinx uses the new version 3.0.0.

With Jinja2 3.0.0 I’ve been getting the following error for all notebooks

'nbformat.notebooknode.NotebookNode object' has no attribute 'tags'

This does not happen if I freeze Jinja2 to 2.11.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 14
  • Comments: 18 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks @astrojuanlu for testing!

I’ve just released version 0.8.6 with a fix for this issue.

Tested with nbsphinx==0.8.6 and jinja2=3.0.1. Python 3.8.7

Also published to ReadTheDocs https://aiqc.readthedocs.io/en/latest/notebooks/heterogeneous_features.html successfully if you want to inspect anything.

Thanks for the fix in #564! I’ve merged it and I’ve just made a new release https://pypi.org/project/nbsphinx/0.8.5/.

If anybody has an idea how to fix the root cause of the problem, please let me know!

Just wanted to add that I am only seeing this bug for pip version 20.2 (well, specifically 20.2.4). Using pip>=20.3.0 also solves the problem.

I’m not sure exactly what changed to cause this, but pip 20.3 made a load of changes to the resolver, so presumably it’s one of the ones listed here: https://pip.pypa.io/en/stable/news/#v20-3