Use constraints with get-pip.py

Combined backport of:
- https://review.openstack.org/558124
- https://review.openstack.org/558599

Presently no constraints are passed to get-pip.py when installing
pip, so we just receive the latest version of pip/setuptools/wheel
everywhere without respecting global-requirement-pins or any other
constraints.

To avoid this we'll pass pip_install_upper_constraints args to
get-pip.py by default.

Change-Id: I32603fd34b60183607c6bd9653c36432cbe6b07a
This commit is contained in:
Logan V 2018-04-01 16:19:44 -05:00 committed by Jesse Pretorius
parent cd7cfb110d
commit 591683aaa9
2 changed files with 15 additions and 5 deletions

View File

@ -65,7 +65,12 @@
- name: pip cache install files locally
local_action: >
command python /tmp/get-pip.py -d '{{ pip_tmp_packages | quote }}' {{ pip_get_pip_options }} {{ pip_packages | map('quote') | join (' ') }}
command python /tmp/get-pip.py
-d '{{ pip_tmp_packages | quote }}'
{{ (pip_install_upper_constraints is defined) |
ternary('--constraint ' ~ pip_install_upper_constraints | default(''), '') }}
{{ pip_get_pip_options }}
{{ pip_packages | map('quote') | join (' ') }}
changed_when: false
register: pip_local_cache
until: pip_local_cache | success

View File

@ -16,7 +16,9 @@
- block:
- name: Install PIP
command: >
python /opt/get-pip.py {{ pip_source_install_options }}
python /opt/get-pip.py {{ (pip_install_upper_constraints is defined) |
ternary('--constraint ' ~ pip_install_upper_constraints | default(''), '') }}
{{ pip_source_install_options }}
{{ pip_get_pip_options }}
{{ pip_packages | map('quote') | join (' ') }}
changed_when: false
@ -28,9 +30,12 @@
rescue:
- name: Install PIP (fall back mode)
command: >
python /opt/get-pip.py --isolated {{ pip_source_install_options }}
{{ pip_get_pip_options }}
{{ pip_packages | map('quote') | join (' ') }}
python /opt/get-pip.py --isolated
{{ (pip_install_upper_constraints is defined) |
ternary('--constraint ' ~ pip_install_upper_constraints | default(''), '') }}
{{ pip_source_install_options }}
{{ pip_get_pip_options }}
{{ pip_packages | map('quote') | join (' ') }}
register: pip_install_fall_back
until: pip_install_fall_back | success
retries: 3