readthedocs / sphinx-autoapi

A new approach to API documentation in Sphinx.
https://sphinx-autoapi.readthedocs.io/
MIT License
439 stars 131 forks source link

KeyError in autoapi/directives.py #356

Closed OATalha closed 2 years ago

OATalha commented 2 years ago

I am trying to compile documentation with autoapi_python_use_implicit_namespaces = True

The following dump is generated, let me know if anything else is needed.

# Sphinx version: 5.3.0
# Python version: 3.9.14 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: 3.0.3
# Last messages:
#   reading sources... [  5%] autoapi/maya/index
#   reading sources... [  5%] autoapi/maya/oa/animation/index
#   reading sources... [  5%] autoapi/maya/oa/animation/libs/anim_curves/clean_anim_curves/index
#   
#   ====================== slowest reading durations =======================
#   0.884 autoapi/bd/storage/errors/index
#   0.363 autoapi/anim_library/tool/utils/anim_library_utils/index
#   0.218 autoapi/anim_library/tool/utils/images2gif/index
#   0.109 autoapi/anim_library/tool/anim_library_tool/index
#   0.108 autoapi/anim_library/tests/test_format/index
# Loaded extensions:
#   sphinx.ext.mathjax (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.2) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.2) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (2.0.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.5) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.3) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/alabaster/__init__.py
#   sphinx.ext.autodoc.preserve_defaults (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/autodoc/preserve_defaults.py
#   sphinx.ext.autodoc.type_comment (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/autodoc/type_comment.py
#   sphinx.ext.autodoc.typehints (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/autodoc/typehints.py
#   sphinx.ext.autodoc (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.autosummary (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/autosummary/__init__.py
#   sphinx.ext.graphviz (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/graphviz.py
#   sphinx.ext.inheritance_diagram (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/inheritance_diagram.py
#   autoapi.extension (unknown version) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/autoapi/extension.py
#   repoget (unknown version) from /devtest/oneanimation-rnd.github.io/docs/source/repoget/__init__.py
#   sphinx.ext.coverage (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/coverage.py
#   sphinx.ext.autosectionlabel (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/autosectionlabel.py
#   sphinx.ext.duration (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/duration.py
#   sphinx.ext.githubpages (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/githubpages.py
#   sphinx.ext.todo (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/todo.py
#   sphinx.ext.extlinks (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/extlinks.py
#   sphinx.ext.intersphinx (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/intersphinx.py
#   sphinx.ext.viewcode (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/viewcode.py
#   sphinx.ext.napoleon (5.3.0) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/napoleon/__init__.py
#   sphinx_rtd_theme (unknown version) from /Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx_rtd_theme/__init__.py
Traceback (most recent call last):
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/cmd/build.py", line 281, in build_main
    app.build(args.force_all, args.filenames)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/application.py", line 347, in build
    self.builder.build_update()
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 310, in build_update
    self.build(to_build,
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 326, in build
    updated_docnames = set(self.read())
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 433, in read
    self._read_serial(docnames)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 454, in _read_serial
    self.read_doc(docname)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 510, in read_doc
    publisher.publish()
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/core.py", line 217, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/io.py", line 104, in read
    self.parse()
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/readers/__init__.py", line 77, in parse
    self.parser.parse(self.input, document)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/parsers.py", line 78, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 170, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 2342, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 2354, in explicit_construct
    return method(self, expmatch)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 2096, in directive
    return self.run_directive(
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/docutils/parsers/rst/states.py", line 2146, in run_directive
    result = directive_instance.run()
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/sphinx/ext/autosummary/__init__.py", line 232, in run
    items = self.get_items(names)
  File "/Volumes/profiles/tahmed/.local/lib/python3.9/site-packages/autoapi/directives.py", line 22, in get_items
    obj = all_objects[name]
KeyError: 'maya.oa.animation.libs.anim_curves.clean_anim_curves.CleanAnimCurves'
OATalha commented 2 years ago

It was due to autoapi_keep_files = True

and then running for the second time.

This was alleviated by deleting the autoapi_root directory.

Perhaps a more helpful error message would be more appropriate.

Sorry for bothering you. You may please close the issue.