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

0.5.0: not ready for sphinx 5.x? #20

Open
kloczek opened this issue Jul 11, 2022 · 1 comment
Open

0.5.0: not ready for sphinx 5.x? #20

kloczek opened this issue Jul 11, 2022 · 1 comment
Assignees
Labels
bug Something isn't working stale

Comments

@kloczek
Copy link

kloczek commented Jul 11, 2022

Looks like documentation build fails with sphinx 5.x

+ /usr/bin/sphinx-build -n -T -b man doc-source build/sphinx/man
Running Sphinx v5.0.2

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 430, in load_extension
    mod = import_module(extname)
  File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3.8/site-packages/sphinx_toolbox/more_autodoc/autoprotocol.py", line 153, in <module>
    from sphinx_toolbox.more_autodoc.generic_bases import _add_generic_bases
  File "/usr/lib/python3.8/site-packages/sphinx_toolbox/more_autodoc/generic_bases.py", line 86, in <module>
    from sphinx_toolbox.more_autosummary import PatchedAutoSummClassDocumenter
  File "/usr/lib/python3.8/site-packages/sphinx_toolbox/more_autosummary/__init__.py", line 170, in <module>
    from sphinx.ext.autodoc.importer import get_module_members
ImportError: cannot import name 'get_module_members' from 'sphinx.ext.autodoc.importer' (/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py)

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

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 223, in __init__
    self.setup_extension(extension)
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 380, in setup_extension
    self.registry.load_extension(self, extname)
  File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 443, in load_extension
    metadata = setup(app)
  File "/usr/lib/python3.8/site-packages/sphinx_toolbox/__init__.py", line 95, in setup
    app.setup_extension("sphinx_toolbox.more_autodoc.autoprotocol")
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 380, in setup_extension
    self.registry.load_extension(self, extname)
  File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 433, in load_extension
    raise ExtensionError(__('Could not import extension %s') % extname,
sphinx.errors.ExtensionError: Could not import extension sphinx_toolbox.more_autodoc.autoprotocol (exception: cannot import name 'get_module_members' from 'sphinx.ext.autodoc.importer' (/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py))

Extension error:
Could not import extension sphinx_toolbox.more_autodoc.autoprotocol (exception: cannot import name 'get_module_members' from 'sphinx.ext.autodoc.importer' (/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py))
@kloczek kloczek added the bug Something isn't working label Jul 11, 2022
@kloczek
Copy link
Author

kloczek commented Jul 11, 2022

I forgot that to be able use straight sphinx-build it is necessary to apply patch like below

--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -19,6 +19,7 @@
 import os
 from datetime import datetime
 import sys
+sys.path.insert(0, os.path.abspath("../.."))
 scripts = os.path.abspath('../../scripts')
 sys.path.insert(0, scripts)
 try:

@stale stale bot added the stale label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants