Commit Graph

16 Commits

Author SHA1 Message Date
yatinkarel 82d321c6fd ensure-sphix: upgrade setuptools in venv
With [1] pip was ensured to be latest, but for
cases like ubuntu bionic which has too old
setuptools(39.0.1) and that doesn't support version
from file, the support only available with
setuptools-39.2.0[2].

This patch proposes to upgrade setuptools
along with pip to support dependencies which
set's version in a file. Other option is to
pass option --use-deprecated legacy-resolver
to pip install or downgrade pip to working version.

This will resolve issue with translation jobs
in neutron which fails during installation of
pyroute2[3].

[1] https://review.opendev.org/c/zuul/zuul-jobs/+/828441
[2] https://github.com/pypa/setuptools/pull/1359/commits/a960ee1c3
[3] https://zuul.openstack.org/builds?job_name=propose-translation-update&project=openstack%2Fneutron

Change-Id: I23475a48fa9cc924962f2f4b5edc7aeb5dd6261c
2022-04-13 20:35:46 +05:30
Ian Wienand e3b7e0dcf6 ensure-sphinx: upgrade pip
Change I98c3da5b02a4ac7fb9d7bd8e00170762e77b9f40 caused a regression,
because previously virtualenv would be pulling the latest pip, whereas
"pip -m venv" is using the system-vendored pip, which is older.

Upgrade pip to the latest in the sphinx environment to maintain the
status-quo.

Change-Id: I1004c2727379f73eafc8b32a3e14842200ad342c
2022-02-09 11:44:06 +11:00
Ian Wienand ab4042e60a ensure-sphinx: Use python3
All our platforms are Python 3 now, so we can simplify this.  We can
remove the virtualenv dependency as ensure-pip installs venv and sets
variables for us to use it when making a virtualenv.

Change-Id: I98c3da5b02a4ac7fb9d7bd8e00170762e77b9f40
2022-02-04 08:03:25 +11:00
Hervé Beraud 6fed1caf0c Allow to retrieve releasenotes requirements from a dedicated place
These changes allow to store reno reqs in a dedicated place.

Indeed some projects just want to build release notes without other
documentation.

The releasenotes playbook will use the ensure-sphinx role so I think it
make sense to allow this specific use case (no doc dir available).

Change-Id: I1d244bb47fb6b0b35df130f34007ff51047cd2f1
2021-01-07 14:00:10 +01:00
Monty Taylor 4651548004 Add ensure-pip and ensure-virtualenv to build-sphinx-docs
We assume they're installed and use them, but we need to make sure
they're installed.

Change-Id: I962d8f432a8beac3acc7545f2cff6d0d99b30cbe
2020-06-16 08:20:58 -05:00
Albin Vass b1b2dca456 ensure-sphinx: use failed_when: false instead of ignore_errors: true
Change-Id: I597bed7ea062b584b4613533b477f5c69404996a
2020-04-28 16:20:20 +02:00
Ian Wienand 2f7ff89384 Python roles: misc doc updates
Some minor formatting things I noticed when reading through the page
of role documentation.

Change-Id: I2f94102badd83d82073df2dfb1e36a524c7b0686
2020-04-17 10:45:26 +02:00
Kevin Carter 167cc321f4 Update the sphinx python package sets
The role will now use a known functional set of packages based on the
version of python being defined.

To allow users to add packages to a known functional version of
sphinx the variable `doc_building_extra_packages` has been added.
This option will union with `doc_building_packages`, installing all
python packages in a single set.

The releasenotes pre playbook has been updated so that it no longer
overrides the default package set when calling the "ensure-sphinx"
role. The playbook will now use the `doc_building_extra_packages`
option and include only the additional packages it needs. This change
allows folks to rely on the role to setup sphinx correctly without
needing to overriding everything.

Change-Id: Ib3d2fda164b173c82f17fabc20814753bfeaec6e
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2019-07-08 07:48:31 -07:00
Akihiro Motoki a4f4351013 Fix build-openstack-releasenotes by non-existing msgmerge
"gettext" command is provided by gettext-base package in Xenial.
To make build-openstack-releasenotes work we need to check commands
like "msgmerge" provided by gettext package.

Change-Id: I6c9f303dd5f284d7df68a4b764b84a05309f6693
2018-10-21 17:28:21 +09:00
Fabien Boucher 8fb6c01f68 ensure-sphinx: do not attempt a gettext install if exists
Avoid failure due to "become: yes" when sudo is not allowed (in
a container for instance). This patch check if gettext is installed
before calling the package module with become: yes.

Change-Id: Ibb7f65afad234b39e50aba429b633d70938738f5
2018-09-06 15:42:05 +02:00
Monty Taylor 0dc2c9466d
Deal with lack of requirements file better
For projects that only need sphinx and no other actual depenedencies,
there's no real value in failing if we don't find a doc requirements
file. We know all things using ensure-sphinx will, in fact, need sphinx.
Past that, it's entirely reasonable for someone to have no other needs.

Change-Id: I07dfa12f4aceee50a2f2c000df937dcbb09dd557
2017-12-18 12:25:03 -06:00
Andreas Jaeger 88279bd6cc Revert "Revert "Add sphinx_python variable to sphinx role and job""
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 68ded2251f.

Change-Id: I481e032834fdbf674157b2c9a8fa6f95fc570ddb
2017-12-13 16:31:26 +01:00
Jens Harbott (frickler) 68ded2251f Revert "Add sphinx_python variable to sphinx role and job"
This reverts commit 1f8c473765.

Change-Id: I98e7414337d58af0f4819163ee0e88702a52c051
2017-12-08 11:10:45 +00:00
David Moreau Simard 1f8c473765
Add sphinx_python variable to sphinx role and job
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
2017-12-05 21:10:15 -05:00
Andreas Jaeger cbe7006974 Fix wrong dir for doc/requirements.txt
The docu directory is called "doc", thus use "doc/requirements.txt".

Fix the typo in the name. Note that the PTI uses "doc" as well, see
https://governance.openstack.org/tc/reference/project-testing-interface.html#documentation

Change-Id: Ifd35cfdd37d43cf6e040727eb1f27472fe589afc
2017-11-22 19:22:01 +01:00
Monty Taylor b493ca62dd
Add general sphinx and reno jobs and role
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
2017-11-20 17:59:28 -06:00