aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-09-11 11:29:30 +0100
committerGravatar Chris Lovering <[email protected]>2024-09-11 11:29:30 +0100
commit5500c5e72770224604d3fa3ac175ed5b1e0cd700 (patch)
treec43ef7f95d918c679048bc5021e9a508f4ba19a1
parentBump dev dependencies to latest (diff)
Ignore symbols starting with __ in the linkcode resolver
Pydantic models add a lot of these, which cause the autodoc typehints to fail
-rw-r--r--docs/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/utils.py b/docs/utils.py
index de40cf6b..567f0d18 100644
--- a/docs/utils.py
+++ b/docs/utils.py
@@ -94,7 +94,7 @@ def linkcode_resolve(repo_link: str, domain: str, info: dict[str, str]) -> str |
pos = _global_assign_pos(source, symbol_name)
if pos is None:
- if symbol_name in ("model_config", "model_fields", "model_computed_fields"):
+ if symbol_name in ("model_config", "model_fields", "model_computed_fields") or symbol_name.startswith("__"):
# These are ClassVars added by pydantic.
# Since they're not in our source code, we cannot resolve them to a url.
return None