sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.61k stars 2.13k forks source link

Could not import extension sphinxcontrib.mermaid (exception: cannot import name 'ExtensionError' from 'sphinx.util' ... #13002

Closed IHMEkaleb closed 1 month ago

IHMEkaleb commented 1 month ago

Describe the bug

When I run sphinx-build with sphinxcontrib.mermaid 0.9.2 and sphinx 8.1.0, I get this error:

sphinx-build /path/to/docs /path/for/build/output
Running Sphinx v8.1.0
loading translations [en]... done

Extension error:
Could not import extension sphinxcontrib.mermaid (exception: cannot import name 'ExtensionError' from 'sphinx.util' (/path/to/my_env/lib/python3.11/site-packages/sphinx/util/__init__.py))

However, with sphinx 8.0.x, it builds fine.

How to Reproduce

  1. Install sphinxcontrib.mermaid 0.9.2 and sphinx 8.1.0, and add the extension.
  2. Run sphinx-build.
  3. Build fails.

Environment Information

`sphinxcontrib.mermaid=0.9.2` and `sphinx=8.1.0`

Sphinx extensions

sphinxcontrib.mermaid

Additional context

Filed same issue with Mermaid: https://github.com/mermaid-js/mermaid/issues/5954

AA-Turner commented 1 month ago

sphinxcontrib.mermaid should use the proper import location for sphinx.errors.ExtensionError.

A

AA-Turner commented 1 month ago

@IHMEkaleb you should report this to https://github.com/mgaitan/sphinxcontrib-mermaid

A

IHMEkaleb commented 1 month ago

@IHMEkaleb you should report this to https://github.com/mgaitan/sphinxcontrib-mermaid

A

Done here: https://github.com/mermaid-js/mermaid/issues/5954

IHMEkaleb commented 1 month ago

Oh, wait, AA-Turner, I see that you responded in that ticket as well and have added it to the 8.1.0 milestone here. Thanks!

jacobtomlinson commented 1 month ago

I've proposed https://github.com/mgaitan/sphinxcontrib-mermaid/pull/161 to resolve this