Skip to content

task decorator is wrongly typed #946

Open
@kasium

Description

@kasium
from invoke.tasks import task
from invoke.collection import Collection

@task
def foo(ctx):
    pass

ns = Collection()
ns.add_task(foo)

leads to an mypy error:

error: Argument 1 to "add_task" of "Collection" has incompatible type "Callable[..., Any]"; expected "Task[Any]"  [arg-type]
    ns.add_task(foo)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions