pyinvoke / invoke

Pythonic task management & command execution.
http://pyinvoke.org
BSD 2-Clause "Simplified" License
4.31k stars 365 forks source link

Task decorator removes docstring #971

Open kasium opened 8 months ago

kasium commented 8 months ago

When using @task, the decorated function loses it's docstring, because internally a functools.wraps is missing here https://github.com/pyinvoke/invoke/blob/edbb0b11b92452201c6516562140a20a2502a413/invoke/tasks.py#L353-L358

Easy to fix:

@wraps(body)
 def inner(body: Callable) -> Task[T]: 
     _task = klass(body, **kwargs) 
     return _task 
pyhedgehog commented 7 months ago

Dupe of #555