Skip to content
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

Allow invoke to run tasks with type hinting #372

Closed
rsxm opened this issue Jul 6, 2016 · 2 comments
Closed

Allow invoke to run tasks with type hinting #372

rsxm opened this issue Jul 6, 2016 · 2 comments

Comments

@rsxm
Copy link

rsxm commented Jul 6, 2016

Issue #248 mentions type hinting, but I think that is for Invoke to use type hinting internally. This issue is to allow Invoke to run tasks with type hinting annotations.

With current master, when defining a task like this:

@task
def hello(name: str = 'Anonymous'):
    print('Hello, {name}!'.format(name=name))

I get the following error message when trying to run this task:

ValueError: Function has keyword-only arguments or annotations, use getfullargspec() API which can support them

I followed the advice and replaced getargspec() in tasks.py with getfullargspec() and everything seems to work.

I don''t know the full implications of this change, but I'll create a fork and run the tests and see if something breaks.

@bitprophet
Copy link
Member

See #357 :)

@rsxm
Copy link
Author

rsxm commented Jul 7, 2016

Thank you! Don't know how I missed that one, I thought I was thorough with my search of existing issues :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants