From bc9dbd610866eb4592a099e53ecb2b000623b985 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Fri, 24 May 2024 00:37:37 +0200 Subject: [PATCH] Improve documentation of enums. --- docs/source/changes.md | 1 + docs/source/conf.py | 1 + docs/source/reference_guides/api.md | 8 +++----- pyproject.toml | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/source/changes.md b/docs/source/changes.md index b29d9f55..70a67c82 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -53,6 +53,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and - {pull}`611` removes the initial task execution status from `pytask_execute_task_log_start`. - {pull}`612` adds validation for data catalog names. +- {pull}`614` improves the documentation of enums. ## 0.4.7 - 2024-03-19 diff --git a/docs/source/conf.py b/docs/source/conf.py index 22848175..2b0c3bf3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -51,6 +51,7 @@ "sphinx_copybutton", "sphinx_click", "sphinx_toolbox.more_autodoc.autoprotocol", + "enum_tools.autoenum", "myst_nb", "sphinx_design", ] diff --git a/docs/source/reference_guides/api.md b/docs/source/reference_guides/api.md index 56204c28..cc69de80 100644 --- a/docs/source/reference_guides/api.md +++ b/docs/source/reference_guides/api.md @@ -250,21 +250,19 @@ attribute of the task function. The exit code of pytask is determined by ```{eval-rst} -.. autoclass:: pytask.ExitCode - :members: - :member-order: bysource +.. autoenum:: pytask.ExitCode ``` Collected items can have the following outcomes ```{eval-rst} -.. autoclass:: pytask.CollectionOutcome +.. autoenum:: pytask.CollectionOutcome ``` Tasks can have the following outcomes ```{eval-rst} -.. autoclass:: pytask.TaskOutcome +.. autoenum:: pytask.TaskOutcome ``` The following exceptions are used to abort the execution of a task with an appropriate diff --git a/pyproject.toml b/pyproject.toml index 8a11a25c..70eb596b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ docs = [ "sphinx-design>=0.3", "sphinx-toolbox", "sphinxext-opengraph", + "enum-tools", ] plugin-list = ["httpx", "tabulate[widechars]", "tqdm"] test = [