aboutsummaryrefslogtreecommitdiffstats
path: root/docs/conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 23636774..683f9e51 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -3,6 +3,7 @@
import contextlib
import functools
+import logging
import os.path
import shutil
import sys
@@ -103,6 +104,17 @@ html_js_files = utils.get_recursive_file_uris(static, "*.js")
utils.build_api_doc()
+class AutoDocFilter(logging.Filter):
+ """Filter out warnings that we deem not important."""
+
+ def filter(self, record: logging.LogRecord) -> bool:
+ """Return whether to filter out a specific warning line."""
+ return "cannot import name 'AbstractSetIntStr' from 'pydantic._internal._utils" not in record.msg
+
+
+sphinx.util.logging.getLogger("sphinx_autodoc_typehints").logger.addFilter(AutoDocFilter())
+
+
def skip(*args) -> bool:
"""Things that should be skipped by the autodoc generation."""
name = args[2]
@@ -118,8 +130,8 @@ def skip(*args) -> bool:
def post_build(_: Sphinx, exception: Exception) -> None:
"""Clean up and process files after the build has finished."""
if exception:
- # Don't accidentally supress exceptions
- raise exception from None
+ # Don't accidentally suppress exceptions
+ raise exception
build_folder = PROJECT_ROOT / "docs" / "build"
main_build = build_folder / "main"
@@ -179,6 +191,7 @@ intersphinx_mapping = {
"discord": ("https://discordpy.readthedocs.io/en/latest/", None),
"aiohttp": ("https://docs.aiohttp.org/en/stable/", None),
"statsd": ("https://statsd.readthedocs.io/en/v3.3/", ("_static/statsd_additional_objects.inv", None)),
+ "pydantic": ("https://docs.pydantic.dev/latest/", None),
}