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.2.5: sphinx warnings and errors #56

Closed
kloczek opened this issue Dec 24, 2021 · 2 comments
Closed

0.2.5: sphinx warnings and errors #56

kloczek opened this issue Dec 24, 2021 · 2 comments
Labels

Comments

@kloczek
Copy link

kloczek commented Dec 24, 2021

Looks like on redndering documentation sphinx shows some sissues. Despite that documentation seems is generated.

+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
running build_sphinx
Running Sphinx v4.3.2
making output directory... done
WARNING: html_static_path entry '_static' does not exist
loading intersphinx inventory from 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] 4 added, 0 changed, 0 removed
reading sources... [100%] unicode_version
WARNING: autodoc: failed to import function '_get_package_version' from module 'wcwidth'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/util/inspect.py", line 448, in safe_getattr
    return getattr(obj, name, *defargs)
AttributeError: module 'wcwidth' has no attribute '_get_package_version'

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

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 110, in import_object
    obj = attrgetter(obj, mangled_name)
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 332, in get_attr
    return autodoc_attrgetter(self.env.app, obj, name, *defargs)
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 2780, in autodoc_attrgetter
    return safe_getattr(obj, name, *defargs)
  File "/usr/lib/python3.8/site-packages/sphinx/util/inspect.py", line 464, in safe_getattr
    raise AttributeError(name) from exc
AttributeError: _get_package_version

/home/tkloczko/rpmbuild/BUILD/wcwidth-0.2.5/wcwidth/wcwidth.py:docstring of wcwidth.wcwidth._wcmatch_version:1: WARNING: duplicate object description of wcwidth._wcmatch_version, other instance in api, use :noindex: for one of them
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-wcwidth.3 { intro unicode_version api } done
build succeeded, 3 warnings.
@jquast jquast added the bug label Jan 13, 2022
@kloczek
Copy link
Author

kloczek commented Apr 11, 2022

Looks like below patch needs to applied:

--- a/docs/conf.py
+++ b/docs/conf.py
@@ -17,9 +17,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('../'))

 # local
 # 3rd-party imports

And than latest sphins is able to generate output however it shows some warnings:

+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v4.5.0
making output directory... done
WARNING: html_static_path entry '_static' does not exist
loading intersphinx inventory from 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] 4 added, 0 changed, 0 removed
reading sources... [100%] unicode_version
WARNING: autodoc: failed to import function '_get_package_version' from module 'wcwidth'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/util/inspect.py", line 440, in safe_getattr
    return getattr(obj, name, *defargs)
AttributeError: module 'wcwidth' has no attribute '_get_package_version'

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

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 102, in import_object
    obj = attrgetter(obj, mangled_name)
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 327, in get_attr
    return autodoc_attrgetter(self.env.app, obj, name, *defargs)
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 2827, in autodoc_attrgetter
    return safe_getattr(obj, name, *defargs)
  File "/usr/lib/python3.8/site-packages/sphinx/util/inspect.py", line 456, in safe_getattr
    raise AttributeError(name) from exc
AttributeError: _get_package_version

/home/tkloczko/rpmbuild/BUILD/wcwidth-0.2.5/wcwidth/wcwidth.py:docstring of wcwidth.wcwidth._wcmatch_version:1: WARNING: duplicate object description of wcwidth._wcmatch_version, other instance in api, use :noindex: for one of them
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-wcwidth.3 { intro unicode_version api } done
build succeeded, 3 warnings.

@jquast
Copy link
Owner

jquast commented Jan 15, 2023

Closed by #61

@jquast jquast closed this as completed Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants