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

3.6.0: sphinx warnings reference target not found #85

Open
kloczek opened this issue Apr 27, 2022 · 0 comments
Open

3.6.0: sphinx warnings reference target not found #85

kloczek opened this issue Apr 27, 2022 · 0 comments

Comments

@kloczek
Copy link

kloczek commented Apr 27, 2022

Forst of all it is not possible now to build documentation using straight `sphinx build

+ /usr/bin/sphinx-build -n -T -b man doc build/sphinx/man
Running Sphinx v4.5.0

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 425, 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 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  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_unlocked
ModuleNotFoundError: No module named 'ZConfig'

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 428, in load_extension
    raise ExtensionError(__('Could not import extension %s') % extname,
sphinx.errors.ExtensionError: Could not import extension ZConfig.sphinx (exception: No module named 'ZConfig')

Extension error:
Could not import extension ZConfig.sphinx (exception: No module named 'ZConfig')

To fix that it needs to be applied patch like below:

--- a/doc/conf.py~      2022-04-27 07:47:08.000000000 +0000
+++ b/doc/conf.py       2022-04-27 07:47:33.869227531 +0000
@@ -16,10 +16,9 @@
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
-
+import os
+import sys
+sys.path.insert(0, os.path.abspath('..'))

 # -- General configuration ------------------------------------------------

This patch does what exactly is mentioned in comment above modified lined.
With that patch it will be guarantee that documentation will be generated out of the code in source tree and not the code installed. It allows as well build docuemtation without tox (which takes time to prepare venv)

Than .. on building my packages I'm using sphinx-build command with -n switch which shows warmings about missing references. These are not critical issues.
Here is the output with warnings:

loading intersphinx inventory from https://docs.python.org/objects.inv...
intersphinx inventory has moved: https://docs.python.org/objects.inv -> https://docs.python.org/3/objects.inv
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 18 added, 0 changed, 0 removed
reading sources... [100%] zconfig
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/tools.rst:16: ERROR: Command ['zconfig', '--help'] failed: [Errno 2] No such file or directory: 'zconfig'
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/tools.rst:27: ERROR: Command ['zconfig_schema2html', '--help'] failed: [Errno 2] No such file or directory: 'zconfig_schema2html'
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-zconfig.3 { using-zconfig using-logging developing-with-zconfig writing-schema standard-datatypes standard-components logging-components writing-components documenting-components zconfig py-mod-zconfig py-mod-datatypes py-mod-loader py-mod-subst py-mod-cmdline tools changelog } /home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/using-zconfig.rst:27: WARNING: py:mod reference target not found: ConfigParser
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/using-zconfig.rst:27: WARNING: py:mod reference target not found: ConfigParser
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/writing-schema.rst:258: WARNING: py:class reference target not found: SectionValue
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/writing-schema.rst:424: WARNING: py:class reference target not found: SectionValue
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/writing-schema.rst:474: WARNING: py:class reference target not found: SectionValue
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/writing-schema.rst:474: WARNING: py:class reference target not found: SectionValue
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/standard-datatypes.rst:96: WARNING: py:class reference target not found: long
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/standard-components.rst:16: WARNING: py:mod reference target not found: ZConfig.components.basic
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/logging-components.rst:8: WARNING: py:mod reference target not found: ZConfig.components.logger
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/logging-components.rst:78: WARNING: py:meth reference target not found: reopen
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/logging-components.rst:78: WARNING: py:mod reference target not found: ZConfig.components.logger.loghandler
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/writing-components.rst:42: WARNING: py:mod reference target not found: noise
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/doc/writing-components.rst:85: WARNING: py:mod reference target not found: noise.server
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/ZConfig/__init__.py:docstring of ZConfig.DataConversionError:3: WARNING: py:func reference target not found: str
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/ZConfig/__init__.py:docstring of ZConfig.DataConversionError:16: WARNING: py:func reference target not found: str
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/ZConfig/loader.py:docstring of ZConfig.loader.Resource:4: WARNING: py:attr reference target not found: file
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/ZConfig/loader.py:docstring of ZConfig.loader.Resource:4: WARNING: py:attr reference target not found: url
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/ZConfig/loader.py:docstring of ZConfig.loader.Resource:4: WARNING: py:meth reference target not found: close
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/ZConfig/loader.py:docstring of ZConfig.loader.Resource:4: WARNING: py:meth reference target not found: file.close
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/ZConfig/loader.py:docstring of ZConfig.loader.Resource:4: WARNING: py:attr reference target not found: file
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/ZConfig/loader.py:docstring of ZConfig.loader.Resource:4: WARNING: py:attr reference target not found: closed
/home/tkloczko/rpmbuild/BUILD/ZConfig-3.6.0/ZConfig/loader.py:docstring of ZConfig.loader.BaseLoader.openResource:3: WARNING: py:func reference target not found: urllib2.urlopen
done
build succeeded, 25 warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant