Skip to content

autodoc of invoke fails with newer versions of sphinx #19

@briggySmalls

Description

@briggySmalls

My builds have started to fail:

Running Sphinx v2.4.4

Exception occurred:
  File "/Users/sambriggs/.local/share/virtualenvs/cookiecutter-pypackage-oT8-zJK2/lib/python3.7/site-packages/sphinx/deprecation.py", line 49, in __getattr__
    return getattr(self._module, name)
AttributeError: module 'sphinx.ext.autodoc' has no attribute 'add_documenter'
The full traceback has been saved in /var/folders/vz/gcfll7gd04z1sbzr9kv2phn80000gn/T/sphinx-err-qijxis7s.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!

The traceback looks like:

# Sphinx version: 2.4.4
# Python version: 3.7.6 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: 2.11.1
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/Users/sambriggs/.local/share/virtualenvs/cookiecutter-pypackage-oT8-zJK2/lib/python3.7/site-packages/sphinx/cmd/build.py", line 275, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/Users/sambriggs/.local/share/virtualenvs/cookiecutter-pypackage-oT8-zJK2/lib/python3.7/site-packages/sphinx/application.py", line 245, in __init__
    self.setup_extension(extension)
  File "/Users/sambriggs/.local/share/virtualenvs/cookiecutter-pypackage-oT8-zJK2/lib/python3.7/site-packages/sphinx/application.py", line 397, in setup_extension
    self.registry.load_extension(self, extname)
  File "/Users/sambriggs/.local/share/virtualenvs/cookiecutter-pypackage-oT8-zJK2/lib/python3.7/site-packages/sphinx/registry.py", line 465, in load_extension
    metadata = setup(app)
  File "/Users/sambriggs/.local/share/virtualenvs/cookiecutter-pypackage-oT8-zJK2/lib/python3.7/site-packages/invocations/autodoc.py", line 90, in setup
    autodoc.add_documenter(TaskDocumenter)
  File "/Users/sambriggs/.local/share/virtualenvs/cookiecutter-pypackage-oT8-zJK2/lib/python3.7/site-packages/sphinx/deprecation.py", line 49, in __getattr__
    return getattr(self._module, name)
AttributeError: module 'sphinx.ext.autodoc' has no attribute 'add_documenter'

The offending line carries an explanation of why the extension is calling an internal API:

NOTE: sooo for now, since a bunch of our other shit breaks on Sphinx 1.7, we are just explicitly calling autodoc's add_documenter. Sadface.

But it looks like now is the time that it needs fixing!

autodoc.add_documenter(TaskDocumenter)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions