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

KeyError: preventing docs building #430

Open
HKaras opened this issue Apr 3, 2024 · 3 comments
Open

KeyError: preventing docs building #430

HKaras opened this issue Apr 3, 2024 · 3 comments
Labels
Needed: Reproduction Case This issue needs a small test case to reproduce the issue before it can be worked on

Comments

@HKaras
Copy link

HKaras commented Apr 3, 2024

I am currently using autoapi to generate the documentation for my project .
The docs build with no issues on my laptop however on github actions I keep running into the following error:

2024-04-03T08:56:19.2068879Z   File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/sphinx/ext/autosummary/__init__.py", line 233, in run
2024-04-03T08:56:19.2068993Z     items = self.get_items(names)
2024-04-03T08:56:19.2069082Z             ^^^^^^^^^^^^^^^^^^^^^
2024-04-03T08:56:19.2069644Z   File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/autoapi/directives.py", line 22, in get_items
2024-04-03T08:56:19.2069744Z     obj = all_objects[name]
2024-04-03T08:56:19.2069829Z           ~~~~~~~~~~~^^^^^^
2024-04-03T08:56:19.2069979Z KeyError: 'autodeer.DEERanalysis'
2024-04-03T08:56:19.2069987Z 
2024-04-03T08:56:19.2070081Z Exception occurred:
2024-04-03T08:56:19.2070649Z   File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/autoapi/directives.py", line 22, in get_items
2024-04-03T08:56:19.2070746Z     obj = all_objects[name]
2024-04-03T08:56:19.2070831Z           ~~~~~~~~~~~^^^^^^
2024-04-03T08:56:19.2070977Z KeyError: 'autodeer.DEERanalysis'
2024-04-03T08:56:19.2071512Z The full traceback has been saved in /tmp/sphinx-err-ngzm16u5.log, if you want to report the issue to the developers.
2024-04-03T08:56:19.2071903Z Please also report this if it was a user error, so that a better error message can be provided next time.
2024-04-03T08:56:19.2072329Z A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

Using python 3.10 or 3.12, autoapi 3.0.0 and sphinx 7.2.6
Is this a known error with a simple fix. Am I doing something wrong?

@HKaras HKaras changed the title KeyError: prevting docs building KeyError: preventing docs building Apr 3, 2024
@stxue1
Copy link

stxue1 commented Apr 11, 2024

I ran into this issue as well with Toil

loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://cwltool.readthedocs.io/en/latest/objects.inv...
building [mo]: targets for 0 po files that are out of date
writing output... 
building [html]: targets for 291 source files that are out of date
updating environment: [new config] 291 added, 0 changed, 0 removed
reading sources... [  2%] autoapi/debugWorkflow/index
Exception occurred:
  File "/home/heaucques/Documents/toil/venv/lib/python3.12/site-packages/autoapi/directives.py", line 22, in get_items
    obj = all_objects[name]
          ~~~~~~~~~~~^^^^^^
KeyError: 'debugWorkflow.initialize_jobs'
The full traceback has been saved in /tmp/sphinx-err-ad1oubiv.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

Also using Python 3.12 with sphinx 7.2.6
Full logs here:
sphinx-err-ad1oubiv.log

@stxue1
Copy link

stxue1 commented Apr 11, 2024

I think was able to resolve this. It seems like sphinx-autoapi was using cached docs from a previous run of sphinx with old source code. After removing the autoapi folder with rm -rf docs/autoapi, the docs are able to build successfully.

@AWhetter
Copy link
Collaborator

@HKaras Is this still an issue for you? Have you tried clearing the cache like @stxue1 suggested?

@AWhetter AWhetter added the Needed: Reproduction Case This issue needs a small test case to reproduce the issue before it can be worked on label Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: Reproduction Case This issue needs a small test case to reproduce the issue before it can be worked on
Projects
None yet
Development

No branches or pull requests

3 participants