-
Notifications
You must be signed in to change notification settings - Fork 373
task decorator is wrongly typed #946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Your code works well on the last version of invoke: In [1]: from invoke.tasks import task
...: from invoke.collection import Collection
...:
...: @task
...: def foo(ctx):
...: pass
...:
...: ns = Collection()
...: ns.add_task(foo)
In [2]: ns
Out[2]: <Collection None: foo>
In [3]: ns.tasks
Out[3]: {'foo': <Task 'foo'>} Which version of
Also, based on the documentation, you may simplify your imports: from invoke import task
from invoke import Collection |
@4sushi the code works but mypy complains as I said |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
leads to an mypy error:
The text was updated successfully, but these errors were encountered: