Skip to content

Commit

Permalink
build: Stop using setup.py to generate documentation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adrienverge committed Apr 14, 2023
1 parent 771c3a0 commit 16eae28
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -W
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
Expand Down
6 changes: 0 additions & 6 deletions setup.cfg
Expand Up @@ -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
Expand Down

0 comments on commit 16eae28

Please sign in to comment.