autodoc2.resolve_all#

Handling of __all__ resolution.

Module Contents#

Classes#

API#

exception autodoc2.resolve_all.AllResolutionError[source]#

Bases: Exception

An error occurred while resolving the __all__.

Initialization

Initialize self. See help(type(self)) for accurate signature.

exception autodoc2.resolve_all.ObjectMissingError[source]#

Bases: autodoc2.resolve_all.AllResolutionError

An object in the __all__ is not available in the database.

Initialization

Initialize self. See help(type(self)) for accurate signature.

exception autodoc2.resolve_all.CircularImportError[source]#

Bases: autodoc2.resolve_all.AllResolutionError

A circular import was detected.

Initialization

Initialize self. See help(type(self)) for accurate signature.

exception autodoc2.resolve_all.NoAllError[source]#

Bases: autodoc2.resolve_all.AllResolutionError

The module does not have an __all__.

Initialization

Initialize self. See help(type(self)) for accurate signature.

class autodoc2.resolve_all.AllResolveResult[source]#

Bases: typing.TypedDict

resolved: dict[str, str] = None#

Resolved is a dict of {full_name: {name}}

errors: list[tuple[str, str]] = None#

Errors are tuples of (full_name, error_message)

class autodoc2.resolve_all.AllResolver(db: autodoc2.db.Database, warn_func: Callable[[str], None] | None = None)[source]#

Initialization

Initialise the resolver.

Parameters:
  • db – the database to use

  • warn_func – a function to call with warnings

clear_cache() None[source]#

Clear the cache.

get_resolved_all(full_name: str, _breadcrumbs: tuple[str, ...] = ()) autodoc2.resolve_all.AllResolveResult[source]#

Yield all names that would be imported by star.

Parameters:
  • full_name – the fully qualified name of the module

  • _breadcrumbs – used to detect circular imports

get_name(name: str) str | None[source]#

Get the item, first by trying the fully qualified name, then by looking at __all__ in parent modules.