From ac8fe7c337b4c45b01ec8c9df04c5bef82e1dd1b Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 30 Oct 2024 17:52:13 +0100 Subject: [PATCH 1/2] Documentation: Update Read the Docs (RTD) configuration --- .readthedocs.yml | 30 ++++++++++++++++++++++++++++++ readthedocs.yml | 5 ----- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 .readthedocs.yml delete mode 100644 readthedocs.yml diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..468dce89 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,30 @@ +# .readthedocs.yml +# Read the Docs configuration file + +# Details +# - https://docs.readthedocs.io/en/stable/config-file/v2.html + +# Required +version: 2 + +build: + os: "ubuntu-24.04" + tools: + python: "3.12" + +python: + install: + - requirements: docs/requirements.txt + +sphinx: + configuration: docs/source/conf.py + + # Use standard HTML builder. + builder: html + + # Fail on all warnings to avoid broken references. + fail_on_warning: true + +# Optionally build your docs in additional formats such as PDF +#formats: +# - pdf diff --git a/readthedocs.yml b/readthedocs.yml deleted file mode 100644 index d53ffa68..00000000 --- a/readthedocs.yml +++ /dev/null @@ -1,5 +0,0 @@ -build: - image: latest - -python: - version: 3.6 From bfc91f867fb8852000941a443c8535a87debf3ab Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 30 Oct 2024 18:05:40 +0100 Subject: [PATCH 2/2] Documentation: Refactor Sphinx dependencies into `setup.py` --- .github/workflows/docs.yaml | 4 ++-- .readthedocs.yml | 5 ++++- DEVELOP.md | 7 ++++++- docs/requirements.txt | 6 ------ setup.py | 4 ++++ 5 files changed, 16 insertions(+), 10 deletions(-) delete mode 100644 docs/requirements.txt diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 57710ae7..b4cb871d 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.11"] + python-version: ["3.12"] steps: - uses: actions/checkout@v4 @@ -31,7 +31,7 @@ jobs: - name: Install package and documentation dependencies run: | - uv pip install --system '.[develop]' --requirement=docs/requirements.txt + uv pip install --system '.[develop,docs]' - name: Run link checker run: | diff --git a/.readthedocs.yml b/.readthedocs.yml index 468dce89..cd5f7886 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -14,7 +14,10 @@ build: python: install: - - requirements: docs/requirements.txt + - method: pip + path: . + extra_requirements: + - docs sphinx: configuration: docs/source/conf.py diff --git a/DEVELOP.md b/DEVELOP.md index e8e381dd..d99938ad 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -8,7 +8,7 @@ git clone https://github.com/kennethreitz/responder cd responder python3 -m venv .venv source .venv/bin/activate -pip install --editable '.[graphql,develop,release,test]' +pip install --editable '.[graphql,develop,docs,release,test]' ``` Invoke linter and software tests. @@ -20,3 +20,8 @@ Format code. ```shell poe format ``` + +Documentation authoring. +```shell +poe docs-autobuild +``` diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index f38e07b2..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -alabaster<1.1 -jinja2<3.2 -markupsafe<4 -readme-renderer<45 -sphinx>=5,<9 -sphinxcontrib-websupport<2.1 diff --git a/setup.py b/setup.py index d4491c3d..0f885e76 100644 --- a/setup.py +++ b/setup.py @@ -121,6 +121,10 @@ def run(self): "ruff; python_version>='3.7'", "validate-pyproject", ], + "docs": [ + "alabaster<1.1", + "sphinx>=5,<9", + ], "graphql": ["graphene"], "release": ["build", "twine"], "test": ["pytest", "pytest-cov", "pytest-mock", "flask"],