Drop empty pip packages from the list
This patch aims to remove empty records from venv_pip_packages list
to avoid pip error due to that.
This also brings _venv_pip_packages variable, which optimize process by
doing union and sort only once.
Change-Id: Ic94f5a00346e47c394bd2cefc1cfca4ed8c3bdef
(cherry picked from commit 6b3d95e13b
)
This commit is contained in:

committed by
Jonathan Rosser

parent
e7a165b1d0
commit
e3bcafaeae
@@ -68,7 +68,7 @@
|
|||||||
copy:
|
copy:
|
||||||
dest: "{{ venv_install_destination_path }}/requirements.txt"
|
dest: "{{ venv_install_destination_path }}/requirements.txt"
|
||||||
content: |
|
content: |
|
||||||
{% for item in (venv_default_pip_packages | union(venv_pip_packages)) | sort %}
|
{% for item in _venv_pip_packages %}
|
||||||
{{ item }}
|
{{ item }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
register: _requirement_file
|
register: _requirement_file
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
block:
|
block:
|
||||||
- name: Install python packages into the venv
|
- name: Install python packages into the venv
|
||||||
pip:
|
pip:
|
||||||
name: "{{ (venv_default_pip_packages | union(venv_pip_packages)) | sort }}"
|
name: "{{ _venv_pip_packages }}"
|
||||||
state: "{{ venv_pip_package_state }}"
|
state: "{{ venv_pip_package_state }}"
|
||||||
virtualenv: "{{ venv_install_destination_path }}"
|
virtualenv: "{{ venv_install_destination_path }}"
|
||||||
extra_args: >-
|
extra_args: >-
|
||||||
|
@@ -80,7 +80,7 @@
|
|||||||
copy:
|
copy:
|
||||||
dest: "{{ venv_build_host_requirements_path }}/{{ venv_install_destination_path | basename }}-requirements.txt"
|
dest: "{{ venv_build_host_requirements_path }}/{{ venv_install_destination_path | basename }}-requirements.txt"
|
||||||
content: |
|
content: |
|
||||||
{% for item in (venv_default_pip_packages | union(venv_pip_packages)) | sort %}
|
{% for item in _venv_pip_packages %}
|
||||||
{{ item }}
|
{{ item }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
register: _requirement_file
|
register: _requirement_file
|
||||||
|
@@ -76,3 +76,5 @@ venv_build_targets: |-
|
|||||||
{% set _ = targets.__setitem__(distro, target_item) %}
|
{% set _ = targets.__setitem__(distro, target_item) %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{{ targets }}
|
{{ targets }}
|
||||||
|
|
||||||
|
_venv_pip_packages: "{{ (venv_default_pip_packages | union(venv_pip_packages)) | sort | select | list }}"
|
||||||
|
Reference in New Issue
Block a user