Skip to content

Commit

Permalink
feat: Add option to disallow inspection
Browse files Browse the repository at this point in the history
Issue #68: #68
PR #69: #69
  • Loading branch information
BlueGlassBlock authored May 4, 2023
1 parent f593bb0 commit 40f2f26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mkdocstrings_handlers/python/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class PythonHandler(BaseHandler):
"annotations_path": "brief",
"preload_modules": None,
"load_external_modules": False,
"allow_inspection": True,
}
"""
Attributes: Headings options:
Expand Down Expand Up @@ -169,6 +170,7 @@ class PythonHandler(BaseHandler):
of the importing module.
The modules must be listed as an array of strings. Default: `None`.
allow_inspection (bool): Whether to allow inspecting modules when visiting them is not possible. Default: `True`.
"""

Expand Down Expand Up @@ -257,6 +259,7 @@ def collect(self, identifier: str, config: Mapping[str, Any]) -> CollectorItem:
docstring_options=parser_options,
modules_collection=self._modules_collection,
lines_collection=self._lines_collection,
allow_inspection=final_config["allow_inspection"],
)
try:
for pre_loaded_module in final_config.get("preload_modules") or []:
Expand Down

0 comments on commit 40f2f26

Please sign in to comment.