Skip to content

Commit

Permalink
add workaround for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Sep 30, 2023
1 parent 7a17f51 commit 6ae3b92
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import logging as pylogging
import os
import os.path as osp
import shutil

from sphinx.util import logging

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand All @@ -37,6 +40,16 @@
"sphinx_autodoc_typehints",
]


# Workaround for https://github.com/agronholm/sphinx-autodoc-typehints/issues/123
class FilterForIssue123(pylogging.Filter):
def filter(self, record: pylogging.LogRecord) -> bool:
return not record.getMessage().startswith("Cannot handle as a local function")


logging.getLogger("sphinx_autodoc_typehints").logger.addFilter(FilterForIssue123())
# End of a workaround

try:
import enchant # type:ignore[import] # noqa

Expand Down

0 comments on commit 6ae3b92

Please sign in to comment.