Skip to content

0.5.0: sphinx warnings reference target not found #5

@kloczek

Description

@kloczek

First of all currently it is not possible to use straight sphinx-build command to build documentation out of source tree

+ /usr/bin/sphinx-build -n -T -b man doc build/sphinx/man
Running Sphinx v4.5.0
making output directory... done
WARNING: html_static_path entry '_static' does not exist
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
WARNING: autodoc: failed to import module 'pyflakes' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import class 'pyflakes.Pyflakes' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import module 'coverage' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import class 'coverage.PythonModule' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import class 'coverage.PythonPackage' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import class 'coverage.Coverage' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import module 'docs' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import function 'docs.spell' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import function 'docs.sphinx' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import function 'docs.pythonhosted_upload' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import module 'package' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
WARNING: autodoc: failed to import class 'package.Package' from module 'doitpy'; the following exception was raised:
No module named 'doitpy'
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-doit-py.3 { } done
build succeeded, 13 warnings.

This can be fixed by patch like below:

--- a/doc/conf.py~      2020-05-24 12:35:05.000000000 +0000
+++ b/doc/conf.py       2022-05-29 08:17:42.055120769 +0000
@@ -19,7 +19,7 @@
 # If extensions (or modules to document with autodoc) are in another directory,
 # 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.
-#sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('..'))

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

This patch fixes what is in the comment and that can of fix is suggested in sphinx example copy.py https://www.sphinx-doc.org/en/master/usage/configuration.html#example-of-configuration-file

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:

+ /usr/bin/sphinx-build -n -T -b man doc build/sphinx/man
Running Sphinx v4.5.0
making output directory... done
WARNING: html_static_path entry '_static' does not exist
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-doit-py.3 { } docstring of doitpy.pyflakes.Pyflakes.config:1: WARNING: py:class reference target not found: confclass.Config
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/pyflakes.py:docstring of doitpy.pyflakes.Pyflakes.config:: WARNING: py:class reference target not found: list-str
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/pyflakes.py:docstring of doitpy.pyflakes.Pyflakes.config:: WARNING: py:class reference target not found: list-str
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.PythonModule:: WARNING: py:class reference target not found: list-str
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.PythonModule:: WARNING: py:class reference target not found: list-str
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.PythonModule.__init__:: WARNING: py:class reference target not found: str/pathlib.Path
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.PythonModule.__init__:: WARNING: py:class reference target not found: str/pathlib.Path
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.PythonPackage:: WARNING: py:class reference target not found: list-str
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.PythonPackage:: WARNING: py:class reference target not found: list-str
docstring of doitpy.coverage.PythonPackage.config:1: WARNING: py:class reference target not found: confclass.Config
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.PythonPackage.__init__:: WARNING: py:class reference target not found: str/pathlib.Path
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.PythonPackage.__init__:: WARNING: py:class reference target not found: str/pathlib.Path
docstring of doitpy.coverage.Coverage.config:1: WARNING: py:class reference target not found: confclass.Config
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.Coverage.config:: WARNING: py:class reference target not found: string
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.Coverage.config:: WARNING: py:class reference target not found: parallel
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.Coverage.config:: WARNING: py:class reference target not found: concurrency
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.Coverage.config:: WARNING: py:class reference target not found: list-str
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/coverage.py:docstring of doitpy.coverage.Coverage.__init__:: WARNING: py:class reference target not found: list-PythonFiles
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/docs.py:docstring of doitpy.docs.spell:: WARNING: py:class reference target not found: list-str
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/docs.py:docstring of doitpy.docs.sphinx:: WARNING: py:class reference target not found: list-str
/home/tkloczko/rpmbuild/BUILD/doit-py-0.5.0/doitpy/docs.py:docstring of doitpy.docs.pythonhosted_upload:: WARNING: py:class reference target not found: list-str
done
build succeeded, 22 warnings.

You can peak on fixes that kind of issues in other projects
latchset/jwcrypto#289
click-contrib/sphinx-click@abc31069
latchset/jwcrypto#289
RDFLib/rdflib-sqlalchemy#95

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions