You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On building sphinxcontrib-mermaid documentation sphinx cannot find sphinxcontrib.mermaid
+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/manRunning Sphinx v6.2.1WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 442, 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 973, in _find_and_load_unlockedModuleNotFoundError: No module named 'sphinxcontrib.mermaid'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 280, in build_main app = Sphinx(args.sourcedir, args.confdir, args.outputdir, File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 229, in __init__ self.setup_extension(extension) File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 404, in setup_extension self.registry.load_extension(self, extname) File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 445, in load_extension raise ExtensionError(__('Could not import extension %s') % extname,sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')Extension error:Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')
So I've checked how it is here with use namespaces na found that it is still used pkg_resources which is now deprecated.
Below patch moves to pkgutil style namespaces because pkg_resources messes with sys.path
+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/manRunning Sphinx v6.2.1WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 442, 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 973, in _find_and_load_unlockedModuleNotFoundError: No module named 'sphinxcontrib.mermaid'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 280, in build_main app = Sphinx(args.sourcedir, args.confdir, args.outputdir, File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 229, in __init__ self.setup_extension(extension) File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 404, in setup_extension self.registry.load_extension(self, extname) File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 445, in load_extension raise ExtensionError(__('Could not import extension %s') % extname,sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')Extension error:Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')
So I've removed sphinxcontrib/init.py and with that sphinx shows errors which indicated that sphinxcontrib-mermaid needs to be updated for sphinx >=6.x
+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/manRunning Sphinx v6.2.1WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).making output directory... doneWARNING: html_static_path entry '_static' does not existbuilding [mo]: targets for 0 po files that are out of datewriting output...building [man]: all manpagesupdating environment: [new config] 1 added, 0 changed, 0 removedreading sources... [100%] indexTraceback (most recent call last): File "/usr/lib/python3.8/site-packages/sphinx/util/__init__.py", line 321, in import_object obj = getattr(obj, name) File "/usr/lib/python3.8/site-packages/sphinx/util/__init__.py", line 403, in __getattr__ raise AttributeError(f'module {__name__!r} has no attribute {name!r}')AttributeError: module 'sphinx.util' has no attribute 'SphinxParallelError'During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/sphinx/util/__init__.py", line 323, in import_object obj = import_module(modname) 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 973, in _find_and_load_unlockedModuleNotFoundError: No module named 'sphinx.util.SphinxParallelError'The above exception was the direct cause of the following exception:Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/sphinxcontrib-mermaid-0.7.1/sphinxcontrib/autoclassdiag.py", line 15, in get_classes obj = import_object(cls_or_module) File "/usr/lib/python3.8/site-packages/sphinx/util/__init__.py", line 330, in import_object raise ExtensionError('Could not import %s' % objname, exc) from excsphinx.errors.ExtensionError: Could not import sphinx.util.SphinxParallelError (exception: No module named 'sphinx.util.SphinxParallelError')During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 285, in build_main app.build(args.force_all, args.filenames) File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 353, in build self.builder.build_update() File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 308, in build_update self.build(['__all__'], to_build) File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 328, in build updated_docnames = set(self.read()) File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 435, in read self._read_serial(docnames) File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 456, in _read_serial self.read_doc(docname) File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 512, in read_doc publisher.publish() File "/usr/lib/python3.8/site-packages/docutils/core.py", line 224, in publish self.document = self.reader.read(self.source, self.parser, File "/usr/lib/python3.8/site-packages/sphinx/io.py", line 108, in read self.parse() File "/usr/lib/python3.8/site-packages/docutils/readers/__init__.py", line 76, in parse self.parser.parse(self.input, document) File "/usr/lib/python3.8/site-packages/sphinx/parsers.py", line 80, in parse self.statemachine.run(inputlines, document, inliner=self.inliner) File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 169, in run results = StateMachineWS.run(self, input_lines, input_offset, File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run context, next_state, result = self.check_line( File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line return method(match, context, next_state) File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2785, in underline self.section(title, source, style, lineno - 1, messages) File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 325, in section self.new_subsection(title, lineno, messages) File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 391, in new_subsection newabsoffset = self.nested_parse( File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 279, in nested_parse state_machine.run(block, input_offset, memo=self.memo, File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 195, in run results = StateMachineWS.run(self, input_lines, input_offset) File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run context, next_state, result = self.check_line( File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line return method(match, context, next_state) File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2355, in explicit_markup nodelist, blank_finish = self.explicit_construct(match) File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2367, in explicit_construct return method(self, expmatch) File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2104, in directive return self.run_directive( File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2154, in run_directive result = directive_instance.run() File "/home/tkloczko/rpmbuild/BUILD/sphinxcontrib-mermaid-0.7.1/sphinxcontrib/mermaid.py", line 107, in run node['code'] = self.get_mm_code() File "/home/tkloczko/rpmbuild/BUILD/sphinxcontrib-mermaid-0.7.1/sphinxcontrib/mermaid.py", line 136, in get_mm_code return class_diagram( File "/home/tkloczko/rpmbuild/BUILD/sphinxcontrib-mermaid-0.7.1/sphinxcontrib/autoclassdiag.py", line 44, in class_diagram for cls in get_classes(*cls_or_modules, strict=strict): File "/home/tkloczko/rpmbuild/BUILD/sphinxcontrib-mermaid-0.7.1/sphinxcontrib/autoclassdiag.py", line 17, in get_classes raise MermaidError(str(e))sphinxcontrib.exceptions.MermaidError: Could not import sphinx.util.SphinxParallelError (exception: No module named 'sphinx.util.SphinxParallelError')Mermaid error:Could not import sphinx.util.SphinxParallelError (exception: No module named 'sphinx.util.SphinxParallelError')
The same is with pytest
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-mermaid-0.7.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-mermaid-0.7.1-2.fc35.x86_64/usr/lib/python3.8/site-packages+ /usr/bin/pytest -ra -m 'not network'==================================================================================== test session starts ====================================================================================platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0rootdir: /home/tkloczko/rpmbuild/BUILD/sphinxcontrib-mermaid-0.7.1collected 5 itemstests/test_html.py EEEEE [100%]========================================================================================== ERRORS ===========================================================================================______________________________________________________________________________ ERROR at setup of test_html_raw ______________________________________________________________________________self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd2c9f880>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd2c9fc40>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try:
> mod = import_module(extname)/usr/lib/python3.8/site-packages/sphinx/registry.py:442:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ level = 0 if name.startswith('.'): if not package: msg = ("the 'package' argument is required to perform a relative " "import for {!r}") raise TypeError(msg.format(name)) for character in name: if character != '.': break level += 1
> return _bootstrap._gcd_import(name[level:], package, level)/usr/lib64/python3.8/importlib/__init__.py:127:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None, level = 0
> ???<frozen importlib._bootstrap>:1014:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???<frozen importlib._bootstrap>:991:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???E ModuleNotFoundError: No module named 'sphinxcontrib.mermaid'<frozen importlib._bootstrap>:973: ModuleNotFoundErrorThe above exception was the direct cause of the following exception:test_params = {'shared_result': None}, app_params = app_params(args=['html'], kwargs={'srcdir': path('/tmp/pytest-of-tkloczko/pytest-35/basic')})make_app = <function make_app.<locals>.make at 0x7fbdd2c8d0d0>, shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fbdd2c44fd0> @pytest.fixture(scope='function') def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable, shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]: """ Provides the 'sphinx.application.Sphinx' object """ args, kwargs = app_params
> app_ = make_app(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make app_: Any = SphinxTestApp(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/util.py:138: in __init__ super().__init__(srcdir, confdir, outdir, doctreedir,/usr/lib/python3.8/site-packages/sphinx/application.py:229: in __init__ self.setup_extension(extension)/usr/lib/python3.8/site-packages/sphinx/application.py:404: in setup_extension self.registry.load_extension(self, extname)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd2c9f880>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd2c9fc40>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try: mod = import_module(extname) except ImportError as err: logger.verbose(__('Original exception:\n') + traceback.format_exc())
> raise ExtensionError(__('Could not import extension %s') % extname, err) from errE sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')/usr/lib/python3.8/site-packages/sphinx/registry.py:445: ExtensionError________________________________________________________________________ ERROR at setup of test_conf_mermaid_version ________________________________________________________________________self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd20dc730>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd20dc820>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try:
> mod = import_module(extname)/usr/lib/python3.8/site-packages/sphinx/registry.py:442:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ level = 0 if name.startswith('.'): if not package: msg = ("the 'package' argument is required to perform a relative " "import for {!r}") raise TypeError(msg.format(name)) for character in name: if character != '.': break level += 1
> return _bootstrap._gcd_import(name[level:], package, level)/usr/lib64/python3.8/importlib/__init__.py:127:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None, level = 0
> ???<frozen importlib._bootstrap>:1014:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???<frozen importlib._bootstrap>:991:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???E ModuleNotFoundError: No module named 'sphinxcontrib.mermaid'<frozen importlib._bootstrap>:973: ModuleNotFoundErrorThe above exception was the direct cause of the following exception:test_params = {'shared_result': None}app_params = app_params(args=['html'], kwargs={'confoverrides': {'mermaid_version': '8.3'}, 'srcdir': path('/tmp/pytest-of-tkloczko/pytest-35/basic')})make_app = <function make_app.<locals>.make at 0x7fbdd21ebf70>, shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fbdd20dc250> @pytest.fixture(scope='function') def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable, shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]: """ Provides the 'sphinx.application.Sphinx' object """ args, kwargs = app_params
> app_ = make_app(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make app_: Any = SphinxTestApp(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/util.py:138: in __init__ super().__init__(srcdir, confdir, outdir, doctreedir,/usr/lib/python3.8/site-packages/sphinx/application.py:229: in __init__ self.setup_extension(extension)/usr/lib/python3.8/site-packages/sphinx/application.py:404: in setup_extension self.registry.load_extension(self, extname)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd20dc730>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd20dc820>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try: mod = import_module(extname) except ImportError as err: logger.verbose(__('Original exception:\n') + traceback.format_exc())
> raise ExtensionError(__('Could not import extension %s') % extname, err) from errE sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')/usr/lib/python3.8/site-packages/sphinx/registry.py:445: ExtensionError______________________________________________________________________ ERROR at setup of test_conf_mermaid_no_version _______________________________________________________________________self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd204f5b0>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd204f790>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try:
> mod = import_module(extname)/usr/lib/python3.8/site-packages/sphinx/registry.py:442:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ level = 0 if name.startswith('.'): if not package: msg = ("the 'package' argument is required to perform a relative " "import for {!r}") raise TypeError(msg.format(name)) for character in name: if character != '.': break level += 1
> return _bootstrap._gcd_import(name[level:], package, level)/usr/lib64/python3.8/importlib/__init__.py:127:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None, level = 0
> ???<frozen importlib._bootstrap>:1014:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???<frozen importlib._bootstrap>:991:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???E ModuleNotFoundError: No module named 'sphinxcontrib.mermaid'<frozen importlib._bootstrap>:973: ModuleNotFoundErrorThe above exception was the direct cause of the following exception:test_params = {'shared_result': None}, app_params = app_params(args=['html'], kwargs={'confoverrides': {'mermaid_version': None}, 'srcdir': path('/tmp/pytest-of-tkloczko/pytest-35/basic')})make_app = <function make_app.<locals>.make at 0x7fbdd28d8040>, shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fbdd204f850> @pytest.fixture(scope='function') def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable, shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]: """ Provides the 'sphinx.application.Sphinx' object """ args, kwargs = app_params
> app_ = make_app(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make app_: Any = SphinxTestApp(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/util.py:138: in __init__ super().__init__(srcdir, confdir, outdir, doctreedir,/usr/lib/python3.8/site-packages/sphinx/application.py:229: in __init__ self.setup_extension(extension)/usr/lib/python3.8/site-packages/sphinx/application.py:404: in setup_extension self.registry.load_extension(self, extname)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd204f5b0>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd204f790>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try: mod = import_module(extname) except ImportError as err: logger.verbose(__('Original exception:\n') + traceback.format_exc())
> raise ExtensionError(__('Could not import extension %s') % extname, err) from errE sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')/usr/lib/python3.8/site-packages/sphinx/registry.py:445: ExtensionError__________________________________________________________________________ ERROR at setup of test_mermaid_init_js ___________________________________________________________________________self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd200b700>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd200b5e0>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try:
> mod = import_module(extname)/usr/lib/python3.8/site-packages/sphinx/registry.py:442:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ level = 0 if name.startswith('.'): if not package: msg = ("the 'package' argument is required to perform a relative " "import for {!r}") raise TypeError(msg.format(name)) for character in name: if character != '.': break level += 1
> return _bootstrap._gcd_import(name[level:], package, level)/usr/lib64/python3.8/importlib/__init__.py:127:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None, level = 0
> ???<frozen importlib._bootstrap>:1014:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???<frozen importlib._bootstrap>:991:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???E ModuleNotFoundError: No module named 'sphinxcontrib.mermaid'<frozen importlib._bootstrap>:973: ModuleNotFoundErrorThe above exception was the direct cause of the following exception:test_params = {'shared_result': None}app_params = app_params(args=['html'], kwargs={'confoverrides': {'mermaid_init_js': 'custom script;'}, 'srcdir': path('/tmp/pytest-of-tkloczko/pytest-35/basic')})make_app = <function make_app.<locals>.make at 0x7fbdd224a940>, shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fbdd200b820> @pytest.fixture(scope='function') def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable, shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]: """ Provides the 'sphinx.application.Sphinx' object """ args, kwargs = app_params
> app_ = make_app(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make app_: Any = SphinxTestApp(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/util.py:138: in __init__ super().__init__(srcdir, confdir, outdir, doctreedir,/usr/lib/python3.8/site-packages/sphinx/application.py:229: in __init__ self.setup_extension(extension)/usr/lib/python3.8/site-packages/sphinx/application.py:404: in setup_extension self.registry.load_extension(self, extname)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd200b700>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd200b5e0>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try: mod = import_module(extname) except ImportError as err: logger.verbose(__('Original exception:\n') + traceback.format_exc())
> raise ExtensionError(__('Could not import extension %s') % extname, err) from errE sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')/usr/lib/python3.8/site-packages/sphinx/registry.py:445: ExtensionError_______________________________________________________________________ ERROR at setup of test_html_raw_from_markdown _______________________________________________________________________self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd2120820>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd2120610>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try:
> mod = import_module(extname)/usr/lib/python3.8/site-packages/sphinx/registry.py:442:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ level = 0 if name.startswith('.'): if not package: msg = ("the 'package' argument is required to perform a relative " "import for {!r}") raise TypeError(msg.format(name)) for character in name: if character != '.': break level += 1
> return _bootstrap._gcd_import(name[level:], package, level)/usr/lib64/python3.8/importlib/__init__.py:127:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', package = None, level = 0
> ???<frozen importlib._bootstrap>:1014:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???<frozen importlib._bootstrap>:991:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name = 'sphinxcontrib.mermaid', import_ = <function _gcd_import at 0x7fbdd51ed4c0>
> ???E ModuleNotFoundError: No module named 'sphinxcontrib.mermaid'<frozen importlib._bootstrap>:973: ModuleNotFoundErrorThe above exception was the direct cause of the following exception:test_params = {'shared_result': None}, app_params = app_params(args=['html'], kwargs={'srcdir': path('/tmp/pytest-of-tkloczko/pytest-35/markdown')})make_app = <function make_app.<locals>.make at 0x7fbdd215f310>, shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fbdd2120550> @pytest.fixture(scope='function') def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable, shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]: """ Provides the 'sphinx.application.Sphinx' object """ args, kwargs = app_params
> app_ = make_app(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make app_: Any = SphinxTestApp(*args, **kwargs)/usr/lib/python3.8/site-packages/sphinx/testing/util.py:138: in __init__ super().__init__(srcdir, confdir, outdir, doctreedir,/usr/lib/python3.8/site-packages/sphinx/application.py:229: in __init__ self.setup_extension(extension)/usr/lib/python3.8/site-packages/sphinx/application.py:404: in setup_extension self.registry.load_extension(self, extname)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _self = <sphinx.registry.SphinxComponentRegistry object at 0x7fbdd2120820>app = <[AttributeError("'SphinxTestApp' object has no attribute 'builder'") raised in repr()] SphinxTestApp object at 0x7fbdd2120610>, extname = 'sphinxcontrib.mermaid' def load_extension(self, app: Sphinx, extname: str) -> None: """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return if extname in EXTENSION_BLACKLIST: logger.warning(__('the extension %r was already merged with Sphinx since ' 'version %s; this extension is ignored.'), extname, EXTENSION_BLACKLIST[extname]) return # update loading context prefix = __('while setting up extension %s:') % extname with prefixed_warnings(prefix): try: mod = import_module(extname) except ImportError as err: logger.verbose(__('Original exception:\n') + traceback.format_exc())
> raise ExtensionError(__('Could not import extension %s') % extname, err) from errE sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')/usr/lib/python3.8/site-packages/sphinx/registry.py:445: ExtensionError===================================================================================== warnings summary ======================================================================================tests/test_html.py::test_html_rawtests/test_html.py::test_html_raw /usr/lib/python3.8/site-packages/sphinxcontrib/htmlhelp/__init__.py:26: RemovedInSphinx80Warning: The alias 'sphinx.util.progress_message' is deprecated, use 'sphinx.http_date.epoch_to_rfc1123' instead. Check CHANGES for Sphinx API modifications. from sphinx.util import progress_message-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html================================================================================== short test summary info ==================================================================================ERROR tests/test_html.py::test_html_raw - sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')ERROR tests/test_html.py::test_conf_mermaid_version - sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')ERROR tests/test_html.py::test_conf_mermaid_no_version - sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')ERROR tests/test_html.py::test_mermaid_init_js - sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')ERROR tests/test_html.py::test_html_raw_from_markdown - sphinx.errors.ExtensionError: Could not import extension sphinxcontrib.mermaid (exception: No module named 'sphinxcontrib.mermaid')=============================================================================== 2 warnings, 5 errors in 0.64s ===============================================================================
The text was updated successfully, but these errors were encountered:
On building
sphinxcontrib-mermaid
documentation sphinx cannot findsphinxcontrib.mermaid
So I've checked how it is here with use namespaces na found that it is still used
pkg_resources
which is now deprecated.Below patch moves to
pkgutil
style namespaces becausepkg_resources
messes withsys.path
However even with that patch sphinx still failed.
So I've removed sphinxcontrib/init.py and with that sphinx shows errors which indicated that
sphinxcontrib-mermaid
needs to be updated for sphinx >=6.xThe same is with pytest
The text was updated successfully, but these errors were encountered: