I'm trying to run Sphinx to document the following Celery task, but am getting an empty document upon generating the Sphinx docs:
@celery.task(name='taskname')
def taskname(data):
"""
Some documentation
"""
...
...whereas the following gets documented fine:
def non_decorated_function(data):
"""
Some documentation
"""
...
I understand that the function signature gets mangled by the celery task decorator, but I thought that the following in conf.py was supposed to fix that:
extensions = [
'sphinx.ext.autodoc',
'celery.contrib.sphinx',
]
My .rst file looks like this:
.. automodule:: tasks
:members:
:undoc-members:
:show-inheritance:
Using autotask does work, but I was hoping to get this working with automodule, as I'm adding this to a significant codebase:
.. automodule:: tasks
:members:
:undoc-members:
:show-inheritance:
.. autotask:: tasks.taskname
Is there any way to fix the celery tasks decorator to be supported by Sphinx documentation?
"""Some documentation"""to"""Some documentation{enter key here}"""- Kobi K"""description{enter}"""- Kobi Kautotaskis the official way to do it see here - Kobi K