autodoc2.utils¶
Utility functions and types.
Module Contents¶
Classes¶
A data item, for the results of the analysis. |
|
The subtypes of warnings for the extension. |
Functions¶
Walk the given folder and yield all required modules. |
Data¶
API¶
- autodoc2.utils.PROPERTY_TYPE = None¶
- autodoc2.utils.ARGS_TYPE = None¶
- class autodoc2.utils.ItemData[source]¶
Bases:
typing.TypedDictA data item, for the results of the analysis.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- args: autodoc2.utils.ARGS_TYPE = None¶
- class autodoc2.utils.WarningSubtypes[source]¶
Bases:
enum.EnumThe subtypes of warnings for the extension.
- CONFIG_ERROR = 'config_error'¶
Issue with configuration validation.
- GIT_CLONE_FAILED = 'git_clone'¶
Failed to clone a git repository.
- MISSING_MODULE = 'missing_module'¶
If the package file/folder does not exist.
- DUPLICATE_ITEM = 'dup_item'¶
Duplicate fully qualified name found during package analysis.
- RENDER_ERROR = 'render'¶
Generic rendering error.
- ALL_MISSING = 'all_missing'¶
__all__ attribute missing or empty in a module.
- ALL_RESOLUTION = 'all_resolve'¶
Issue with resolution of an item in a module’s __all__ attribute.
- NAME_NOT_FOUND = 'missing'¶
- autodoc2.utils.yield_modules(folder: str | pathlib.Path, *, root_module: str | None = None, extensions: Sequence[str] = ('.py', '.pyi'), exclude_dirs: Sequence[str] = ('__pycache__',), exclude_files: Sequence[str] = ()) Iterable[tuple[pathlib.Path, str]][source]¶
Walk the given folder and yield all required modules.
- Parameters:
folder – The path to walk.
root_module – The name of the root module, otherwise the folder name is used.
extensions – The extensions to include. If multiple files with the same stem, only the first extension will be used.
exclude_dirs – Directory names to exclude (matched with fnmatch).
exclude_files – File names to exclude (matched with fnmatch).