Chilipp / autodocsumm

Extending your autodoc API docs with a summary
Apache License 2.0
48 stars 14 forks source link

Sphinx 4.0.0 breaks autodocsumm #51

Closed andy-maier closed 3 years ago

andy-maier commented 3 years ago

Earlier today, sphinx 4.0.0 was released, and it removed a function the autodocsumm package depends on.

This causes the autodocsumm package to fail when trying to import 'force_decode' from 'sphinx.util' when invoking Sphinx to build.

From GitHub Actions run https://github.com/pywbem/pywbem/runs/2537231242?check_suite_focus=true:

sphinx-build -b html -v -d build_doc/doctrees -c docs -D latex_elements.papersize=a4 . build_doc/html
Running Sphinx v4.0.0
Original exception:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/registry.py", line 420, in load_extension
    mod = import_module(extname)

  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/registry.py", line 420, in load_extension
    mod = import_module(extname)
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/autodocsumm/__init__.py", line 43, in <module>
    from sphinx.util import force_decode
ImportError: cannot import name 'force_decode' from 'sphinx.util' (/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/util/__init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/cmd/build.py", line 276, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/application.py", line 243, in __init__
    self.setup_extension(extension)
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/application.py", line 400, in setup_extension
    self.registry.load_extension(self, extname)
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/registry.py", line 423, in load_extension
    raise ExtensionError(__('Could not import extension %s') % extname,
sphinx.errors.ExtensionError: Could not import extension autodocsumm (exception: cannot import name 'force_decode' from 'sphinx.util' (/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/util/__init__.py))

Extension error:
Could not import extension autodocsumm (exception: cannot import name 'force_decode' from 'sphinx.util' (/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/util/__init__.py))
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/autodocsumm/__init__.py", line 43, in <module>
    from sphinx.util import force_decode
ImportError: cannot import name 'force_decode' from 'sphinx.util' (/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/sphinx/util/__init__.py)
Chilipp commented 3 years ago

hey @andy-maier! thanks for this input. I'll have a look at it now

Chilipp commented 3 years ago

alright, it has been fixed and a new release is out on pypi: version 0.2.4