Skip to content

Commit

Permalink
Gross hack no longer required
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 10, 2024
1 parent cb1078a commit 13a038b
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions autoautosummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.ext import autosummary
from sphinx.ext.autodoc import MethodDocumenter
from sphinx.ext.autosummary import Autosummary, ImportExceptionGroup
from sphinx.locale import __
from sphinx.util import logging
from sphinx.util.inspect import isstaticmethod, safe_getattr

from documenters import OverloadedPythonMethodDocumenter

# from sphinx.directives import directive
logger = logging.getLogger(__name__)

Expand All @@ -37,21 +34,6 @@ def new_extract_summary(doc: list[str], document: Any) -> str:

autosummary.extract_summary = new_extract_summary

old_get_documenter = autosummary.get_documenter


def new_get_documenter(app, obj: Any, parent: Any):
res = old_get_documenter(app, obj, parent)
if issubclass(res, OverloadedPythonMethodDocumenter):
# sorry, gross hack! OverloadedPythonMethodDocumenter works well
# for generating the actual docs, but fails when we are building
# the table of contents. So fallback to original class instead...
return MethodDocumenter
return res


autosummary.get_documenter = new_get_documenter


class AutoAutoSummary(Autosummary):
"""
Expand Down

0 comments on commit 13a038b

Please sign in to comment.