<#3245 [BUG] Sphinx autodoc's automodule does not ...
# flyte-github
c
#3245 [BUG] Sphinx autodoc's automodule does not work with functions decorated with task or workflow decorators Issue created by ggydush ### Describe the bug Sphinx autodoc is useful for automating documentation. I'm trying to use Sphinx's autodoc extension to document tasks/workflows using the
automodule
directive, and any function that is using the
task
or
workflow
decorators is not properly being associated with the module. ### Expected behavior Automodule directive should work with functions decorated with task or workflow decorators. ### Additional context to reproduce If I have a file in
project/example.py
from flytekit import task, workflow @task def example_task(x: int) -> int: """My test task. Args: x: Integer for test """ return x @workflow def example_workflow(x: int) -> int: return example_task(x=x) Usually I can have Sphinx document these functions with: .. automodule:: project.example However, the task/workflow functions are not getting picked up by Sphinx. If I reference the object directly with: .. autoclass:: project.example.example_task Sphinx can find the example_task and properly document it using autodoc. ### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte