PackageResult

class PackageResult(stubs_written: list[Path] = <factory>, failed: list[tuple[~pathlib.Path, list[~stubpy.diagnostics.Diagnostic]]]=<factory>)[source]

Bases: object

Outcome of a generate_package() run.

stubs_written

Absolute paths of every .pyi file successfully written.

Type:

list of Path

failed

One entry per source file that raised an exception or accumulated ERROR-level diagnostics. Each entry is (source_path, diagnostics).

Type:

list of tuple[Path, list[Diagnostic]]

Examples

>>> r = PackageResult()
>>> r.summary()
'Generated 0 stubs, 0 failed.'
stubs_written: list[Path]
failed: list[tuple[Path, list[Diagnostic]]]
summary() str[source]

Return a one-line human-readable summary.

Examples

>>> r = PackageResult(stubs_written=[Path("a.pyi")], failed=[])
>>> r.summary()
'Generated 1 stub, 0 failed.'
__init__(stubs_written: list[Path] = <factory>, failed: list[tuple[~pathlib.Path, list[~stubpy.diagnostics.Diagnostic]]]=<factory>) None

See also

Public API reference — overview of all public names.