From 8d252eb00a340708bb82bd50ceefd9a03a96acef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Fri, 14 Apr 2023 11:38:19 +0200 Subject: [PATCH] build: Stop using setup.py to generate documentation Because `setup.py` is deprecated, let's switch from: python setup.py build_sphinx to: make -C docs html to build Sphinx documentation. The generated HTML files in `docs/_build/html` are exactly the same (I compared with `diff -qr`). Also add `-W` (turn warnings into errors) to the `sphinx-build` options to keep the previous behavior. --- .github/workflows/ci.yaml | 2 +- docs/Makefile | 2 +- setup.cfg | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d99696ef..1f0b62d7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,7 +28,7 @@ jobs: - run: doc8 $(git ls-files '*.rst') - run: rstcheck --ignore-directives automodule $(git ls-files '*.rst') - run: yamllint --strict $(git ls-files '*.yaml' '*.yml') - - run: python setup.py build_sphinx + - run: make -C docs html - name: Check for broken links in documentation run: make -C docs linkcheck diff --git a/docs/Makefile b/docs/Makefile index 8223a7d0..0426d425 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = +SPHINXOPTS = -W SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build diff --git a/setup.cfg b/setup.cfg index a14f0f70..501fc04a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,12 +3,6 @@ import-order-style = pep8 application-import-names = yamllint ignore = W503,W504 -[build_sphinx] -all-files = 1 -source-dir = docs -build-dir = docs/_build -warning-is-error = 1 - [metadata] keywords = yaml