From a98166716e9ddab73207943f50393a474585dcc0 Mon Sep 17 00:00:00 2001 From: Moritz Sommer Date: Mon, 26 May 2025 13:15:55 +0200 Subject: [PATCH] sdk/docs: Move documentation dependencies to pyproject.toml Previously, the build-dependencies for the sphinx autodocumentation were listed in `sdk/docs/add-requirements.txt`. This is outdated and the new state of the art is managing all dependencies via `pyproject.toml`. This refactors the dependencies from `sdk/docs/add-requirements.txt` into a new optional `[docs]` section in the `pyproject.toml` dependency definitions. Furthermore, we adapt the `.github/workflows/ci.yml` to use the new definitions accordingly. Fixes #384 --- .github/workflows/ci.yml | 3 +-- sdk/.readthedocs.yaml | 3 ++- sdk/docs/add-requirements.txt | 4 ---- sdk/pyproject.toml | 5 +++++ 4 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 sdk/docs/add-requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b01fa262..277492844 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,8 +161,7 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install . - pip install -r docs/add-requirements.txt + pip install .[docs] - name: Check documentation for errors run: | SPHINXOPTS="-a -E -n -W --keep-going" make -C docs html diff --git a/sdk/.readthedocs.yaml b/sdk/.readthedocs.yaml index e64e5daaf..1085208ac 100644 --- a/sdk/.readthedocs.yaml +++ b/sdk/.readthedocs.yaml @@ -15,4 +15,5 @@ python: install: - method: pip path: . - - requirements: docs/add-requirements.txt + extra_requirements: + - docs diff --git a/sdk/docs/add-requirements.txt b/sdk/docs/add-requirements.txt deleted file mode 100644 index 6ac2c1473..000000000 --- a/sdk/docs/add-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Additional requirements for building the docs -sphinx~=8.2 -sphinx-rtd-theme~=3.0 -sphinx-argparse~=0.5.0 diff --git a/sdk/pyproject.toml b/sdk/pyproject.toml index baaf6ff05..3a9fb6832 100644 --- a/sdk/pyproject.toml +++ b/sdk/pyproject.toml @@ -55,6 +55,11 @@ dev = [ "types-python-dateutil", "lxml-stubs~=0.5.1", ] +docs= [ + "sphinx~=8.2", + "sphinx-rtd-theme~=3.0", + "sphinx-argparse~=0.5.0" +] [project.urls] "Homepage" = "https://github.com/eclipse-basyx/basyx-python-sdk"