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
This commit is contained in:
Monty Taylor 2017-12-18 12:19:16 -06:00
parent aed3385b26
commit 0dc2c9466d
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594

View File

@ -23,19 +23,10 @@
break break
fi fi
done done
failed_when: "'requirements.txt' not in requirements_file.stdout"
register: requirements_file register: requirements_file
# TODO(dmsimard) Don't assume virtualenv is installed # TODO(dmsimard) Don't assume virtualenv is installed
- name: Initialize virtual environment - name: Install base doc building packages
pip:
requirements: "{{ requirements_file.stdout }}"
chdir: "{{ zuul_work_dir }}"
virtualenv: "{{ zuul_work_virtualenv }}"
virtualenv_python: "{{ sphinx_python }}"
extra_args: "{{ upper_constraints | default(omit) }}"
- name: Install doc building packages
pip: pip:
name: "{{ item }}" name: "{{ item }}"
chdir: "{{ zuul_work_dir }}" chdir: "{{ zuul_work_dir }}"
@ -43,3 +34,13 @@
virtualenv_python: "{{ sphinx_python }}" virtualenv_python: "{{ sphinx_python }}"
extra_args: "{{ upper_constraints | default(omit) }}" extra_args: "{{ upper_constraints | default(omit) }}"
with_items: "{{ doc_building_packages }}" with_items: "{{ doc_building_packages }}"
# TODO(dmsimard) Don't assume virtualenv is installed
- name: Install found doc requirements
pip:
requirements: "{{ requirements_file.stdout }}"
chdir: "{{ zuul_work_dir }}"
virtualenv: "{{ zuul_work_virtualenv }}"
virtualenv_python: "{{ sphinx_python }}"
extra_args: "{{ upper_constraints | default(omit) }}"
when: requirements_file.stdout_lines