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
This commit is contained in:
Ian Wienand 2022-02-03 16:30:47 +11:00
parent 9b89ebcebd
commit ab4042e60a
5 changed files with 8 additions and 17 deletions

View File

@ -25,9 +25,10 @@ All pip installs are done with a provided constraints file, if given.
By default this list is empty.
.. zuul:rolevar:: sphinx_python
:default: python2
:default: python3
Version of python to use, either ``python2`` or ``python3``.
**Deprecated**
Version of python to use, only supports ``python3``.
.. zuul:rolevar:: zuul_work_virtualenv
:default: ~/.venv

View File

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

View File

@ -2,10 +2,6 @@
include_role:
name: ensure-pip
- name: Install virtualenv
include_role:
name: ensure-virtualenv
# NOTE: gettext command is provided by gettext-base package,
# so we need to check a command provided by gettext package.
- name: Check for gettext installed
@ -41,15 +37,12 @@
done
register: requirements_file
- name: Gather python version variables
include_vars: "{{ sphinx_python.split('.')[0] }}.yaml"
- name: Install base doc building packages
pip:
name: "{{ doc_building_packages | union(doc_building_extra_packages) }}"
chdir: "{{ zuul_work_dir }}"
virtualenv: "{{ zuul_work_virtualenv }}"
virtualenv_python: "{{ sphinx_python }}"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
extra_args: "{{ upper_constraints | default(omit) }}"
- name: Install found doc requirements
@ -57,6 +50,6 @@
requirements: "{{ requirements_file.stdout }}"
chdir: "{{ zuul_work_dir }}"
virtualenv: "{{ zuul_work_virtualenv }}"
virtualenv_python: "{{ sphinx_python }}"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
extra_args: "{{ upper_constraints | default(omit) }}"
when: requirements_file.stdout_lines

View File

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

View File

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