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
1 changed files with 11 additions and 10 deletions

View File

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