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

Task decorator removes docstring #971

Open
kasium opened this issue Oct 9, 2023 · 1 comment
Open

Task decorator removes docstring #971

kasium opened this issue Oct 9, 2023 · 1 comment

Comments

@kasium
Copy link

kasium commented Oct 9, 2023

When using @task, the decorated function loses it's docstring, because internally a functools.wraps is missing here

invoke/invoke/tasks.py

Lines 353 to 358 in edbb0b1

kwargs["pre"] = args
def inner(body: Callable) -> Task[T]:
_task = klass(body, **kwargs)
return _task

Easy to fix:

@wraps(body)
 def inner(body: Callable) -> Task[T]: 
     _task = klass(body, **kwargs) 
     return _task 
@pyhedgehog
Copy link

Dupe of #555

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

No branches or pull requests

2 participants