Skip to content

Support for type checking with Pyright #8

@disrupted

Description

@disrupted

Pyright currently complains when using dtyper as a drop-in replacement that @app.command decorators are missing self as parameter.

error: Type of "command" is partially unknown
    Type of "command" is "_Wrapped[(self: typer.main.Typer, name: str | None = None, *, cls: type[TyperCommand] | None = None, context_settings: Dict[Any, Any] | None = None, help: str | None = None, epilog: str | None = None, short_help: str | None = None, options_metavar: str = "[OPTIONS]", add_help_option: bool = True, no_args_is_help: bool = False, hidden: bool = False, deprecated: bool = False, rich_help_panel: str | None = Default(None)), (CommandFunctionType@command) -> CommandFunctionType@command, (self: dtyper.Typer, *a: Unknown, **ka: Unknown), _Wrapped[(CommandFunctionType@command), CommandFunctionType@command, (f: Unknown), (...) -> Unknown]]" (reportUnknownMemberType)
error: Argument missing for parameter "self" (reportGeneralTypeIssues)
error: Untyped function decorator obscures type of function; ignoring decorator (reportUntypedFunctionDecorator)

probably it could be solved by adding more complete type annotations to dtyper.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions