From 585d2ce3bf717caec6a037b050bbd5b3c9b0d05a Mon Sep 17 00:00:00 2001 From: Webster Mudge Date: Wed, 8 Mar 2023 17:10:29 -0500 Subject: [PATCH 1/2] Update to Sphinx 4 Signed-off-by: Webster Mudge --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 2ddf98a..e4ed240 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,5 @@ # Requirements file for ReadTheDocs, check .readthedocs.yml. # To build the module reference correctly, make sure every external package # under `install_requires` in `setup.cfg` is also listed here! -sphinx>=3.2.1 +sphinx>=4 # sphinx_rtd_theme From ab07dccc4b99dd8209200126bf9cd194b2526583 Mon Sep 17 00:00:00 2001 From: Webster Mudge Date: Wed, 8 Mar 2023 17:10:29 -0500 Subject: [PATCH 2/2] Add tox environments for build, clean, and doc management Signed-off-by: Webster Mudge --- setup.cfg | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/setup.cfg b/setup.cfg index 0118cac..c5adcb5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -127,3 +127,43 @@ deps = pytest-sugar commands = pytest {tty:--color=yes} {posargs} + +[testenv:{build,clean}] +description = + build: Build the package in isolation according to PEP517, see https://github.com/pypa/build + clean: Remove old distribution files and temporary build artifacts (./build and ./dist) +# https://setuptools.pypa.io/en/stable/build_meta.html#how-to-use-it +skip_install = True +changedir = {toxinidir} +deps = + build: build[virtualenv] +passenv = + SETUPTOOLS_* +commands = + clean: python -c 'import shutil; [shutil.rmtree(p, True) for p in ("build", "dist", "docs/_build")]' + clean: python -c 'import pathlib, shutil; [shutil.rmtree(p, True) for p in pathlib.Path("src").glob("*.egg-info")]' + build: python -m build {posargs} + +[testenv:{docs,doctests,linkcheck}] +description = + docs: Invoke sphinx-build to build the docs + doctests: Invoke sphinx-build to run doctests + linkcheck: Check for broken links in the documentation +passenv = + SETUPTOOLS_* +setenv = + DOCSDIR = {toxinidir}/docs + BUILDDIR = {toxinidir}/docs/_build + docs: BUILD = html + doctests: BUILD = doctest + linkcheck: BUILD = linkcheck +# skip_install = true +allowlist_externals=echo +deps = + -r {toxinidir}/docs/requirements.txt + # ^ requirements.txt shared with Read The Docs +# See https://github.com/Kopfstein/pyscaffold-gh-pages-deploy/blob/main/action.yml +commands = + echo "Docs build chain is unavailable via tox - blocked by a hard requirement of docutils in cdpcli. Use the Sphinx 'make' as an alternative." + exit + sphinx-build --color -b {env:BUILD} -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" {posargs}