coderefinery / sphinx-lesson

Sphinx extension for creating CodeRefinery lessons
https://coderefinery.github.io/sphinx-lesson/
MIT License
15 stars 20 forks source link

error locally after upgrading sphinx_lesson #84

Closed wikfeldt closed 2 years ago

wikfeldt commented 2 years ago

after upgrading sphinx_lesson from 0.8.7 to 0.8.10 i get this error locally:

Extension error (sphinx_lesson.exerciselist):
Handler <function find_exerciselist_nodes at 0x1099034c0> for event 'env-check-consistency' threw an exception (exception: No such config value: root_doc)

This happens also in a repo where it worked with 0.8.7

@rkdarst

rkdarst commented 2 years ago

What project is this?

It seems like the root_doc configuration isn't defined. Probably it is this: root_doc = app.config.root_doc.

But, for example, git-intro doesn't explicitly define this, either. Did you recreate with the latest version of Sphinx, too?

Actually, yes, I need to add some backwards compatibility in here:

Changed in version 4.0: Renamed root_doc from master_doc.

rkdarst commented 2 years ago

Yeah, fails with sphinx<4. In the short term, upgrade sphinx (probably not bad anyway), in the long term, I am adding backwards compatibility.

rkdarst commented 2 years ago

Interestingly, the test gh-action already tries to test other Sphinx versions. I thought that pip would not upgrade automatically, unless --upgrade was specified. I have also adjusted things to test all versions properly.

I guess there is no hurry if a local upgrade fixes it, so this can be merged and released at some convenient time later. Is that OK?

wikfeldt commented 2 years ago

indeed that's the problem, thanks.

Curiously, after updating sphinx i ran into an earlier-seen (googlable) error:

WARNING: unknown node type: <pending_xref: <inline...>>

and

Exception occurred:
  File "/Users/ktw/miniconda3/envs/sphinx/lib/python3.10/site-packages/docutils/nodes.py", line 2056, in unknown_departure
    raise NotImplementedError(
NotImplementedError: <class 'sphinx.writers.html5.HTML5Translator'> departing unknown node type: pending_xref

only way to fix it was to remove a {ref}'section-label' from an exercise section (with backticks, can't be bothered to find how to escape it...). But this is something different, so this issue can be closed