Add ability to set upper constraints file
When this role executes the installation of packages for SNI support it should also respect upper constraints. This patch adds the ability to set an upper constraint file URL/path. The tox config is also adjusted to ensure that it makes use of upper constraints when installing requirements. Change-Id: I2ab6f55096b560a7b443de412df168e26a3eca07
This commit is contained in:
parent
c45165acd3
commit
92fbfc238d
@ -32,6 +32,9 @@ pip_tmp_packages: /tmp/pip_install
|
||||
pip_get_pip_options: ""
|
||||
pip_source_install_options: ""
|
||||
|
||||
# The URL/path of a constraints file to use when installing the additional pip packages.
|
||||
#pip_install_upper_constraints: "http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt"
|
||||
|
||||
# This list var can be used to specify specific versions of pip, setuptools,
|
||||
# wheel and any other packages which must be installed when pip installs.
|
||||
pip_packages:
|
||||
|
@ -35,23 +35,32 @@
|
||||
retries: 3
|
||||
delay: 2
|
||||
|
||||
- name: Set pip_install_options_fact (with upper constraints)
|
||||
set_fact:
|
||||
pip_install_options_fact: "--constraint {{ pip_install_upper_constraints }} {{ pip_install_options }}"
|
||||
when: pip_install_upper_constraints is defined
|
||||
|
||||
- name: Set pip_install_options_fact (without upper constraints)
|
||||
set_fact:
|
||||
pip_install_options_fact: "{{ pip_install_options }}"
|
||||
when: pip_install_upper_constraints is not defined
|
||||
|
||||
- name: Install pip packages
|
||||
pip:
|
||||
name: "{{ pip_required_pip_packages | map('quote') | join(' ') }}"
|
||||
state: latest
|
||||
extra_args: "{{ pip_install_options }}"
|
||||
extra_args: "{{ pip_install_options_fact }}"
|
||||
failed_when: false
|
||||
register: install_packages
|
||||
until: install_packages | success
|
||||
retries: 5
|
||||
delay: 2
|
||||
|
||||
|
||||
- name: Install pip packages (fall back mode)
|
||||
pip:
|
||||
name: "{{ pip_required_pip_packages | map('quote') | join(' ') }}"
|
||||
state: latest
|
||||
extra_args: "--isolated {{ pip_install_options }}"
|
||||
extra_args: "--isolated {{ pip_install_options_fact }}"
|
||||
when: install_packages | failed
|
||||
register: install_packages_fall_back
|
||||
until: install_packages_fall_back | success
|
||||
|
@ -19,6 +19,7 @@
|
||||
vars:
|
||||
pip_packages:
|
||||
- "pip==8.0.3"
|
||||
pip_install_upper_constraints: "http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt"
|
||||
roles:
|
||||
- role: "pip_install"
|
||||
post_tasks:
|
||||
|
2
tox.ini
2
tox.ini
@ -107,7 +107,7 @@ commands =
|
||||
# it doesn't work in OpenStack-CI yet. Once that's fixed, we can
|
||||
# drop the install_command.
|
||||
install_command =
|
||||
pip install -U --force-reinstall {opts} {packages}
|
||||
pip install -c https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt {opts} {packages}
|
||||
|
||||
|
||||
[testenv:functional]
|
||||
|
Loading…
Reference in New Issue
Block a user