Add option to upgrade PyPI/etc without using site config

There are sometimes buggy releases of PyPI shipped by the
distributions which don't react well to pip.conf config
options such extra index URLs which make it impossible to
upgrade it.

This adds a a variable which allows working around this
issue by ignoring the site config to do the upgrade.

Change-Id: I5266d827f19e14c6313b11408913e2f754befaca
This commit is contained in:
Mohammed Naser 2019-03-29 12:24:11 -04:00
parent 95db88a9ff
commit c94cd6c4b6
3 changed files with 9 additions and 0 deletions

View File

@ -56,6 +56,11 @@ venv_default_pip_packages: []
# into the venv.
venv_pip_packages: []
# Don't use the site-wide PIP configuration file when
# upgrading PIP (some operating systems have issued
# with upgrades w/ extra-index-urls)
venv_pip_upgrade_noconf: false
# A list of constraints to be applied when building
# or installing python packages.
venv_build_constraints: []

View File

@ -100,6 +100,8 @@
--log /var/log/python_venv_build.log
{{ venv_default_pip_install_args }}
{{ venv_pip_install_args }}
environment:
PIP_CONFIG_FILE: "{{ (venv_pip_upgrade_noconf | bool) | ternary('/dev/null', '') }}"
register: _update_virtualenv_packages
until: _update_virtualenv_packages is success
retries: 5

View File

@ -99,6 +99,8 @@
--find-links {{ venv_build_host_wheel_path }}/
--log /var/log/python_venv_build.log
{{ venv_pip_build_args }}
environment:
PIP_CONFIG_FILE: "{{ (venv_pip_upgrade_noconf | bool) | ternary('/dev/null', '') }}"
register: _update_virtualenv_packages
until: _update_virtualenv_packages is success
retries: 5