[PATCH] dts: mock pydantic for autodoc

Patrick Robb probb at iol.unh.edu
Thu Nov 13 22:56:17 CET 2025


Mock the Pydantic import so that even when Pydantic
is available on the system, it is not loaded by
Sphinx, ensuring we perform the doc build without
Pydantic regardless of the environment.

Signed-off-by: Patrick Robb <probb at iol.unh.edu>
---
 doc/guides/conf.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/doc/guides/conf.py b/doc/guides/conf.py
index 2c1aa81bbf..29d5cf019d 100644
--- a/doc/guides/conf.py
+++ b/doc/guides/conf.py
@@ -106,6 +106,9 @@
     # fabric.Connection (without) vs. fabric.connection.Connection (with)
     autodoc_mock_imports = importlib.import_module('check-dts-requirements').get_missing_imports()
 
+    # Always mock Pydantic to avoid autodoc introspecting its internals
+    autodoc_mock_imports = list(set(autodoc_mock_imports + ['pydantic', 'pydantic_core']))
+
 
 # ####### :numref: fallback ########
 # The following hook functions add some simple handling for the :numref:
-- 
2.49.0



More information about the dev mailing list