diff --git a/defaults/main.yml b/defaults/main.yml index e74d997..6ba0114 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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: [] diff --git a/tasks/python_venv_install.yml b/tasks/python_venv_install.yml index 514a328..7f8f573 100644 --- a/tasks/python_venv_install.yml +++ b/tasks/python_venv_install.yml @@ -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 diff --git a/tasks/python_venv_wheel_build.yml b/tasks/python_venv_wheel_build.yml index 7ef3978..d1f5c25 100644 --- a/tasks/python_venv_wheel_build.yml +++ b/tasks/python_venv_wheel_build.yml @@ -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