Browse Source

Merge "Update the sphinx python package sets"

changes/48/669948/1
Zuul 1 month ago
parent
commit
410907d004

+ 1
- 2
playbooks/releasenotes/pre.yaml View File

@@ -4,7 +4,6 @@
4 4
       bindep_profile: doc
5 5
       bindep_dir: "{{ zuul_work_dir }}"
6 6
     - role: ensure-sphinx
7
-      doc_building_packages:
8
-        - sphinx
7
+      doc_building_extra_packages:
9 8
         - reno
10 9
     - revoke-sudo

+ 9
- 2
roles/ensure-sphinx/README.rst View File

@@ -12,9 +12,16 @@ All pip installs are done with a provided constraints file, if given.
12 12
    Optional path to a pip constraints file for installing python libraries.
13 13
 
14 14
 .. zuul:rolevar:: doc_building_packages
15
-   :default: ['sphinx']
15
+   :default: ``list``
16 16
 
17
-   List of python packages to install for building docs.
17
+   List of python packages to install for building docs. The default
18
+   package list is based on the python version in use.
19
+
20
+.. zuul:rolevar:: doc_building_extra_packages
21
+   :default: ``list``
22
+
23
+   List of python additional packages to install for building docs.
24
+   By default this list is empty.
18 25
 
19 26
 .. zuul:rolevar:: sphinx_python
20 27
    :default: python2

+ 2
- 2
roles/ensure-sphinx/defaults/main.yaml View File

@@ -1,5 +1,5 @@
1 1
 zuul_work_dir: "{{ zuul.project.src_dir }}"
2 2
 zuul_work_virtualenv: "{{ ansible_user_dir }}/.venv"
3 3
 sphinx_python: python2
4
-doc_building_packages:
5
-  - sphinx
4
+doc_building_packages: "{{ _doc_building_packages | default([]) }}"
5
+doc_building_extra_packages: []

+ 6
- 2
roles/ensure-sphinx/tasks/main.yaml View File

@@ -1,3 +1,5 @@
1
+---
2
+
1 3
 # NOTE: gettext command is provided by gettext-base package,
2 4
 # so we need to check a command provided by gettext package.
3 5
 - name: Check for gettext installed
@@ -33,15 +35,17 @@
33 35
       done
34 36
   register: requirements_file
35 37
 
38
+- name: Gather python version variables
39
+  include_vars: "{{ sphinx_python.split('.')[0] }}.yaml"
40
+
36 41
 # TODO(dmsimard) Don't assume virtualenv is installed
37 42
 - name: Install base doc building packages
38 43
   pip:
39
-    name: "{{ item }}"
44
+    name: "{{ doc_building_packages | union(doc_building_extra_packages) }}"
40 45
     chdir: "{{ zuul_work_dir }}"
41 46
     virtualenv: "{{ zuul_work_virtualenv }}"
42 47
     virtualenv_python: "{{ sphinx_python }}"
43 48
     extra_args: "{{ upper_constraints | default(omit) }}"
44
-  with_items: "{{ doc_building_packages }}"
45 49
 
46 50
 # TODO(dmsimard) Don't assume virtualenv is installed
47 51
 - name: Install found doc requirements

+ 2
- 0
roles/ensure-sphinx/vars/python2.yaml View File

@@ -0,0 +1,2 @@
1
+_doc_building_packages:
2
+  - sphinx<2.0

+ 2
- 0
roles/ensure-sphinx/vars/python3.yaml View File

@@ -0,0 +1,2 @@
1
+_doc_building_packages:
2
+  - sphinx

Loading…
Cancel
Save