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
Consider a class that has an attribute without a default value, and is imported. If autoclass is applied to this class and autosummary is turned on, sphinx-build errors out.
Running Sphinx v3.4.1
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
Traceback (most recent call last):
File "/home/hong/.local/lib/python3.7/site-packages/sphinx/cmd/build.py", line 280, in build_main
app.build(args.force_all, filenames)
File "/home/hong/.local/lib/python3.7/site-packages/sphinx/application.py", line 352, in build
self.builder.build_update()
File "/home/hong/.local/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 298, in build_update
len(to_build))
File "/home/hong/.local/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 310, in build
updated_docnames = set(self.read())
File "/usr/lib/python3.7/contextlib.py", line 119, in __exit__
next(self.gen)
File "/home/hong/.local/lib/python3.7/site-packages/sphinx/util/logging.py", line 214, in pending_warnings
memhandler.flushTo(logger)
File "/home/hong/.local/lib/python3.7/site-packages/sphinx/util/logging.py", line 179, in flushTo
logger.handle(record)
File "/usr/lib/python3.7/logging/__init__.py", line 1529, in handle
self.callHandlers(record)
File "/usr/lib/python3.7/logging/__init__.py", line 1591, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.7/logging/__init__.py", line 901, in handle
rv = self.filter(record)
File "/usr/lib/python3.7/logging/__init__.py", line 762, in filter
result = f.filter(record)
File "/home/hong/.local/lib/python3.7/site-packages/sphinx/util/logging.py", line 422, in filter
raise exc
sphinx.errors.SphinxWarning: /home/hong/tmp/myproject/_impl.py:docstring of myproject._impl.A.rst:1:autosummary: failed to import myproject.A.a
Warning, treated as error:
/home/hong/tmp/myproject/_impl.py:docstring of myproject._impl.A.rst:1:autosummary: failed to import myproject.A.a
Hey @xuhdev ! Thanks a lot for reporting this issue. I think that this should rather be resolved within the autosummary extension, shouldn't it? I saw that you already created the corresponding issue in the sphinx repo, so maybe we keep this issue here open and close it when sphinx-doc/sphinx#8645 has been resolved
Hi @Chilipp ! I'm not sure whether the two issues are actually the same issue: sphinx-doc/sphinx#8645 doesn't involve imported module, but this issue is only reproduceable if an imported module is involved. But they may be related though, I just don't understand the extension enough to make the judgment.
xuhdev
added a commit
to xuhdev/poorconn
that referenced
this issue
May 31, 2021
Cause errors such as:
```
poorconn/poorconn/_pytest_plugin.py:docstring of poorconn._pytest_plugin.Server.rst:1:autosummary: failed to import poorconn.pytest_plugin.Server.url
```
in !49.
See Chilipp/autodocsumm#41
Consider a class that has an attribute without a default value, and is imported. If
autoclass
is applied to this class andautosummary
is turned on,sphinx-build
errors out.Reproduce
Download
bug.tar.gz. Unarchive it, and run
It produces an error:
Content of
bug.tar.gz
:_impl.py
:__init__.py
:conf.py
:index.rst
:Either removing
:autosummary:
or put the definition of class A to__init__.py
resolves the error.The text was updated successfully, but these errors were encountered: