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 <[email protected]> --- 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

