Using sphinx autodoc for a fabfile
Its because you've applied decorator on your function setup_development
you need to update your task
function with functools.wraps
as below,
from functools import wraps
def task(calling_func):
@wraps(calling_func)
def wrapper_func(self, *args, **kw):
return calling_func(*args, **kw)
return wrapper_func
If you document decorated functions or methods, keep in mind that autodoc retrieves its docstrings by importing the module and inspecting the __doc__
attribute of the given function or method.
That means that if a decorator replaces the decorated function with another, it must copy the original __doc__
to the new function.
From Python 2.5
, functools.wraps()
can be used to create well-behaved decorating functions.
References:
Python Sphinx autodoc and decorated members
https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-autoexception