zuul-jobs/roles/tox/tasks/siblings.yaml
Ian Wienand f76cfbab11 linters: fix spaces between filters
This fixes a number of places where we do not have spaces between
filters.  I think that this is a reasonable rule for readability (I
also think it probably was enforced, but maybe later versions got
better at detecting it?).

These are detected by a later version of Ansible lint; this change
should have no operational change to any roles but prepares us to
update in a follow-on change.

Change-Id: I07e1a109b87adce86f483d14d7e02fcecb8313d5
2022-07-27 17:13:39 +10:00

50 lines
1.6 KiB
YAML

# Install sibling with tox so we can replace them later
- name: Run tox without tests
command: >-
{{ tox_executable }}
{% if tox_config_file is defined and tox_config_file %}
-c{{ tox_config_file }}
{% endif %}
--notest
{% if tox_envlist is defined and tox_envlist %}
-e{{ tox_envlist }}
{% endif %}
{{ tox_extra_args }}
args:
chdir: "{{ zuul_work_dir }}"
environment: "{{ tox_environment | combine(tox_constraints_env | default({})) }}"
# This is needed since python < 3.2 can't parse ini files from strings
- name: Create a tempfile to save tox showconfig
tempfile:
register: _tox_show_config_tempfile
- name: Get tox envlist config
shell: >-
{{ tox_executable }}
{% if tox_config_file is defined and tox_config_file %}
-c{{ tox_config_file }}
{% endif %}
--showconfig
{% if tox_envlist is defined and tox_envlist %}
-e{{ tox_envlist }}
{% endif %}
{{ tox_extra_args }}
> {{ _tox_show_config_tempfile.path }}
args:
chdir: "{{ zuul_work_dir }}"
environment: "{{ tox_environment | combine(tox_constraints_env | default({})) }}"
- name: Install any sibling python packages
tox_install_sibling_packages:
tox_show_config: "{{ _tox_show_config_tempfile.path }}"
tox_constraints_file: "{{ tox_constraints_file | default(omit) }}"
tox_package_name: "{{ tox_package_name | default(omit) }}"
project_dir: "{{ zuul_work_dir }}"
projects: "{{ zuul.projects.values() | selectattr('required') | list }}"
- name: Remove tempfile
file:
state: absent
path: "{{ _tox_show_config_tempfile.path }}"