(
obj_type: _AutodocObjType,
name: str,
*,
config: _AutodocConfig = _DEFAULT_CONFIG,
current_document: _CurrentDocument | None = None,
events: FakeEvents | None = None,
expect_import_error: bool = False,
options: dict[str, Any] | None = None,
ref_context: Mapping[str, str | None] | None = None,
)
| 37 | |
| 38 | |
| 39 | def do_autodoc( |
| 40 | obj_type: _AutodocObjType, |
| 41 | name: str, |
| 42 | *, |
| 43 | config: _AutodocConfig = _DEFAULT_CONFIG, |
| 44 | current_document: _CurrentDocument | None = None, |
| 45 | events: FakeEvents | None = None, |
| 46 | expect_import_error: bool = False, |
| 47 | options: dict[str, Any] | None = None, |
| 48 | ref_context: Mapping[str, str | None] | None = None, |
| 49 | ) -> list[str]: |
| 50 | if current_document is None: |
| 51 | current_document = _CurrentDocument(docname='index') |
| 52 | if events is None: |
| 53 | events = FakeEvents() |
| 54 | if ref_context is None: |
| 55 | ref_context = {} |
| 56 | reread_always: set[str] = set() |
| 57 | |
| 58 | options = {} if options is None else options.copy() |
| 59 | doc_options = _process_documenter_options( |
| 60 | obj_type=obj_type, |
| 61 | default_options=config.autodoc_default_options, |
| 62 | options=options, |
| 63 | ) |
| 64 | |
| 65 | content = _auto_document_object( |
| 66 | name=name, |
| 67 | obj_type=obj_type, |
| 68 | config=config, |
| 69 | current_document=current_document, |
| 70 | events=events, |
| 71 | get_attr=safe_getattr, |
| 72 | more_content=None, |
| 73 | options=doc_options, |
| 74 | record_dependencies=set(), |
| 75 | ref_context=ref_context, |
| 76 | reread_always=reread_always, |
| 77 | ) |
| 78 | if expect_import_error: |
| 79 | assert content is None |
| 80 | return [] |
| 81 | |
| 82 | assert content is not None |
| 83 | return content.data |
searching dependent graphs…