From 74f0a2fac926aba086d2f59cfac00a4844904fce Mon Sep 17 00:00:00 2001 From: Stuart Reed Date: Mon, 15 Apr 2024 11:23:46 -0600 Subject: [PATCH] `sphinx-autobuild` for live docs updates (#129) * `sphinx-autobuild` for live docs updates. * Use Python 3.9 and `sphinx-autobuild` `2024.2.4` --- .circleci/config.yml | 2 +- .readthedocs.yaml | 2 +- Makefile | 4 ++++ setup.py | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 71e64413..f42d71a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,7 +99,7 @@ jobs: docs: <<: *docs docker: - - image: cimg/python:3.8 + - image: cimg/python:3.9 environment: TOXENV: docs diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e55e07e4..acf57208 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.9" sphinx: configuration: docs/conf.py diff --git a/Makefile b/Makefile index 8ed201bf..fdbe5cb5 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ help: @echo "lint - fix linting issues with pre-commit" @echo "test - run tests quickly with the default Python" @echo "docs - generate docs and open in browser (linux-docs for version on linux)" + @echo "autobuild-docs - live update docs when changes are saved" @echo "notes - consume towncrier newsfragments/ and update release notes in docs/" @echo "release - package and upload a release (does not run notes target)" @echo "dist - package" @@ -33,6 +34,9 @@ lint: test: pytest tests +autobuild-docs: + sphinx-autobuild --open-browser docs docs/_build/html + build-docs: sphinx-apidoc -o docs/ . setup.py "*conftest*" $(MAKE) -C docs clean diff --git a/setup.py b/setup.py index c2247fee..484f113b 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ extras_require = { ], "docs": [ "sphinx>=6.0.0", + "sphinx-autobuild>=2024.2.4", "sphinx_rtd_theme>=1.0.0", "towncrier>=21,<22", ],