Skip to content

Commit bc51394

Browse files
committed
feat: allow force_inspection option to be configurable
1 parent 941d0e5 commit bc51394

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mkdocstrings_handlers/python/handler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ class PythonHandler(BaseHandler):
116116
"annotations_path": "brief",
117117
"preload_modules": None,
118118
"allow_inspection": True,
119+
"force_inspection": False,
119120
"summary": False,
120121
"show_labels": True,
121122
"unwrap_annotated": False,
@@ -127,6 +128,7 @@ class PythonHandler(BaseHandler):
127128
Attributes: General options:
128129
find_stubs_package (bool): Whether to load stubs package (package-stubs) when extracting docstrings. Default `False`.
129130
allow_inspection (bool): Whether to allow inspecting modules when visiting them is not possible. Default: `True`.
131+
force_inspection (bool): Whether to force using dynamic analysis when loading data. Default: `False`.
130132
show_bases (bool): Show the base classes of a class. Default: `True`.
131133
show_inheritance_diagram (bool): Show the inheritance diagram of a class using Mermaid. Default: `False`.
132134
show_source (bool): Show the source code of this object. Default: `True`.
@@ -318,6 +320,7 @@ def collect(self, identifier: str, config: Mapping[str, Any]) -> CollectorItem:
318320
modules_collection=self._modules_collection,
319321
lines_collection=self._lines_collection,
320322
allow_inspection=final_config["allow_inspection"],
323+
force_inspection=final_config["force_inspection"],
321324
)
322325
try:
323326
for pre_loaded_module in final_config.get("preload_modules") or []:

0 commit comments

Comments
 (0)