diff --git a/tasks/python_venv_install.yml b/tasks/python_venv_install.yml index 5eb16b8..cd265f7 100644 --- a/tasks/python_venv_install.yml +++ b/tasks/python_venv_install.yml @@ -91,8 +91,8 @@ - name: Build requirements file for the venv copy: dest: "{{ venv_install_destination_path }}/requirements.txt" - content: | - {% for item in _venv_install_pip_packages %} + content: |- + {% for item in _venv_install_pip_packages | select() %} {{ item }} {% endfor %} register: _requirement_file @@ -100,8 +100,8 @@ - name: Build global constraints file for the venv copy: dest: "{{ venv_install_destination_path }}/global-constraints.txt" - content: | - {% for item in venv_build_global_constraints %} + content: |- + {% for item in venv_build_global_constraints | select() %} {{ item }} {% endfor %} register: _global_constraint_file @@ -109,16 +109,16 @@ - name: Build constraints file for the venv copy: dest: "{{ venv_install_destination_path }}/constraints.txt" - content: | - {% if (venv_wheel_build_enable | bool) and + content: |- + {%- if (venv_wheel_build_enable | bool) and (_constraints_file_slurp is defined) and (_constraints_file_slurp.content is defined) %} {{ _constraints_file_slurp.content | b64decode }} - {% else %} - {% for item in venv_build_constraints %} + {%- else %} + {% for item in venv_build_constraints | select() %} {{ item }} {% endfor %} - {% endif %} + {%- endif %} register: _constraint_file - name: Upgrade pip/setuptools/wheel to the versions we want diff --git a/tasks/python_venv_wheel_build.yml b/tasks/python_venv_wheel_build.yml index 3ed5415..8f2a64a 100644 --- a/tasks/python_venv_wheel_build.yml +++ b/tasks/python_venv_wheel_build.yml @@ -69,8 +69,8 @@ - name: Build requirements file for the venv copy: dest: "{{ _venv_build_requirements_prefix }}-requirements.txt" - content: | - {% for item in _venv_pip_packages %} + content: |- + {% for item in _venv_pip_packages | select() %} {{ item }} {% endfor %} owner: "{{ venv_build_host_user_name | default(omit) }}" @@ -80,8 +80,8 @@ - name: Build global constraints file for the venv copy: dest: "{{ _venv_build_requirements_prefix }}-global-constraints.txt" - content: | - {% for item in venv_build_global_constraints %} + content: |- + {% for item in venv_build_global_constraints | select() %} {{ item }} {% endfor %} owner: "{{ venv_build_host_user_name | default(omit) }}" @@ -91,8 +91,8 @@ - name: Build constraints file for the venv copy: dest: "{{ _venv_build_requirements_prefix }}-source-constraints.txt" - content: | - {% for item in venv_build_constraints %} + content: |- + {% for item in venv_build_constraints | select() %} {{ item }} {% endfor %} owner: "{{ venv_build_host_user_name | default(omit) }}" @@ -171,7 +171,7 @@ - name: Build constraints file for installation purposes copy: - content: | + content: |- {% for file_data in _built_wheels['files'] %} {% set file_name = file_data['path'] | basename %} {{ file_name.split('-')[0] | lower }}=={{ (file_name.split('-')[1].split('_')) | join('.post') | lower }}