Skip to content

Extensions Order Dependence in conf.py #4221

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

Closed
Shaun-Griffith-Hive opened this issue Nov 6, 2017 · 2 comments
Closed

Extensions Order Dependence in conf.py #4221

Shaun-Griffith-Hive opened this issue Nov 6, 2017 · 2 comments

Comments

@Shaun-Griffith-Hive
Copy link

Subject: The order of extensions listed in the conf.py extensions array can cause an error.

Problem

  • Napoleon extension listed before Autodoc extension causes an error, as autodoc is not handled first.

Procedure to reproduce the problem

sphinx-quickstart --quiet \
 --project='some project name' \
 --author=some_author  \
 -v 0.1  \
 --release 0.1.1  \
 --dot=_ \
 --ext-autodoc \
 --ext-todo \
 --ext-viewcode \
 --extensions=sphinx.ext.napoleon \
 --makefile \
 --no-batchfile

Workaround: specify the extensions in the --extensions list, with autodoc before napoleon. The extensions are emitted into conf.py in the order given in the option:

sphinx-quickstart --quiet \
 --project='some project name' \
 --author=some_author  \
 -v 0.1  \
 --release 0.1.1  \
 --dot=_ \
 --extensions=sphinx.ext.autodoc,sphinx.ext.todo,sphinx.ext.viewcode,sphinx.ext.napoleon \
 --makefile \
 --no-batchfile

Error logs / results

Extension error:
Unknown event name: autodoc-process-docstring

Expected results

Finished: An initial directory structure has been created.

You should now populate your master file ./index.rst and create other documentation
source files. Use the Makefile to build the docs, like so:
   make builder
where "builder" is one of the supported builders, e.g. html, latex or linkcheck.

Reproducible project / your project

Environment info

  • OS: Linux 16.04
  • Python version: 3.6.3
  • Sphinx version: 1.6.5
@anntzer
Copy link
Contributor

anntzer commented Nov 8, 2017

I very recently reported a similar issue with numpydoc (numpy/numpydoc#141). I would assume that for this case, sphinx.ext.napoleon should just force-load sphinx.ext.autodoc at the very beginning.

tk0miya added a commit to tk0miya/sphinx that referenced this issue Nov 11, 2017
@tk0miya tk0miya added this to the 1.6.6 milestone Nov 11, 2017
tk0miya added a commit that referenced this issue Nov 12, 2017
…licitly

Fix #4221: napoleon depends on autodoc, but users need to load it man…
@tk0miya
Copy link
Member

tk0miya commented Nov 12, 2017

Fixed at #4233 . Thank you for reporting!

@tk0miya tk0miya closed this as completed Nov 12, 2017
supcik added a commit to passeport-vacances/pvfr-passeport-credential that referenced this issue May 7, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants