From 524e37da18bcca17e9f1c7e3d6c77255de6c4f63 Mon Sep 17 00:00:00 2001 From: Mariusz Karpiarz Date: Wed, 14 Dec 2022 12:13:12 +0000 Subject: [PATCH] Add missing api-ref envlist to tox This is a follow-up to: https://review.opendev.org/c/openstack/cloudkitty/+/867122 We need to add the `[testenv:api-ref]` section to `tox.ini` to be able to run `tox -e api-ref`, which is what Zuul uses to build the API refs. Sphinx had to be capped to the latest version 4 or otherwise `tox` fails with the "add_content() takes 2 positional arguments but 3 were given" error message. Change-Id: I65b008152e2bc64f29229996c87ad4587fe85043 --- api-ref/source/_static | 1 + doc/requirements.txt | 2 +- tox.ini | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 120000 api-ref/source/_static diff --git a/api-ref/source/_static b/api-ref/source/_static new file mode 120000 index 00000000..af789d70 --- /dev/null +++ b/api-ref/source/_static @@ -0,0 +1 @@ +../../doc/source/_static \ No newline at end of file diff --git a/doc/requirements.txt b/doc/requirements.txt index 2639062d..e1d3e7ec 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,4 @@ -sphinx>=3.3.1 # BSD +sphinx>=3.3.1,<5.0.0 # BSD openstackdocstheme>=2.2.6 # Apache-2.0 sphinxcontrib-httpdomain>=1.7.0 # BSD sphinxcontrib-pecanwsme>=0.10.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 5965fcc5..36f0f977 100644 --- a/tox.ini +++ b/tox.ini @@ -66,6 +66,15 @@ commands = sphinx-build -W --keep-going -b html doc/source doc/build/html # sphinx-build -W --keep-going -b latex doc/source doc/build/pdf # make -C doc/build/pdf +[testenv:api-ref] +# This environment is called from CI scripts to test and publish +# the API Ref to docs.openstack.org. +deps = -r{toxinidir}/doc/requirements.txt +allowlist_externals = rm +commands = + rm -rf api-ref/build + sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html + [testenv:venv] commands = {posargs}