sphinx_warning_is_error and sphinx-pbr_autodoc are only useful for the
default documents living in doc/ - but not for api-ref, api-guide, etc.
Check for standard builds and do not run the "python setup.py
build_sphinx" or whereto for non-standard paths.
Change-Id: Ia8edd8a6ebc24f67a52d77c21b0cfa467e45a7ce
PBR supports two flags for autodoc in sphinx, autodoc_index_modules and
autodoc_tree_index_modules. We were only supporting
autodoc_index_modules but some projects like keystone use
autodoc_tree_index_modules. Address this by setting the autodoc flag to
true if either is set to true and defer to pbr to figure out what it
means.
Change-Id: If856e4b838d013781c0690b4ac1c2b37900d0fdd
There are a non-zero number of projects in OpenStack that are still
using pbr.autodoc_index_modules. Switching to the new sphinx build job
breaks them if they have warning-is-error turned on, as their docs are
expecting a reference to the autogenerated module doc indexes.
We should come up with a better solution for migrating them ... probably
a sphinx plugin that one can use with some options and whatnot. Or we
can commit a copy of the generated autoindex file and then treat it as
actual source code moving forward.
For now we need to run those projects with the pbr modified sphinx
builder. This adds support to the setup.cfg value lookup module
for looking up autodoc_index_modules and plumbs it in to the sphinx
invocation.
A note has also been left with an idea for how to simplify this and
remove the python module (we can ini lookup on the executor) but
implementing that is left as an exercise for later.
Change-Id: Ie0c9f24df09255e871f904e079b68809144b36b4
The first version of this change was broken, fix it with updating
roles/ensure-sphinx/tasks/main.yaml to run the test-requirements check
really on the remove node.
This reverts commit 68ded2251f34d2938eb7d91e846dd0e8ad6c892f.
Change-Id: I481e032834fdbf674157b2c9a8fa6f95fc570ddb
Some projects, such as Zuul itself, need to use python3 to build docs.
This adds a new parameter, sphinx_python, which defines the version
of python to build documentation with. The default is python2 and
projects can choose python3 on a need basis.
Remove the comment about the need for a leading comment, since there
is now a real need for the leading comment anyway.
Replace a few direct references to {{ ansible_user_dir }}/.venv that
should have been using zuul_work_virtualenv.
Update sphinx invocation to source the virtualenv activate first.
Some sphinx modules, such as sphinxcontrib.programoutput, attempt to
execute programs and only invoking sphinx-build with the relative
path causes the paths to not be set up properly.
Co-Authored-By: David Moreau Simard <dmsimard@redhat.com>
Change-Id: Ie5e2c93f88465f4aa746827ff88a585dbaa44fd5
Sphinx currently does not have a way to set warning-is-error in a config
file for builds that do not use python setup.py build_sphinx. It's
perfectly reasonable to use Sphinx for non-python languages, but putting
a setup.cfg into those projects is a bit weird. While we wait on getting
a config setting upstream, read the value out of setup.cfg ourselves if
it exists. This will let existing python projects with the setting work
as we expect, but will also let us just set a zuul variable for
non-python projects if we decide to not just put a setup.cfg in them.
Change-Id: Ie65dcb42c48e6a962f6715f7483ef3758caf2965
Sphinx jobs and reno jobs need basically the same thing for
dependencies. So make a new role, ensure-sphinx, which is
parameterizable enough that it can be used by both reno and sphinx jobs.
Make build jobs for both releasenotes and sphinx docs, as both of these
things are perfectly valid things to do in both OpenStack and
non-OpenStack contexts. We'll add an openstack specific job in
openstack-zuul-jobs that uses these as parents but adds the requirements
repo and constraints file settings.
Some of the pip commands here can be improved once
https://github.com/ansible/ansible/pull/33098 lands and is released,
which would allow specifying --user and -c as parameters to the pip
module.
Change-Id: Idd7caf7d88b56d61872906027b4ce7d743572ded
Needed-By: I57de14580f39b9e1c11a587b51b44b61b02c84da