From 8f1129e9899e1ed3cf3fc5f06cb93b84f91bc651 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Sat, 25 Aug 2018 21:40:48 +0100 Subject: [PATCH] Upgrade pip/setuptools/wheel in the venv To ensure a uniform experience across distributions and from build to build, we need to ensure that the venv has a consistent version of pip, setuptools and wheel. This patch ensures that these packages are upgraded to the latest version allowed by the args provided. This prevents issues as discovered and solved by https://review.openstack.org/596553 We also remove the virtualenv_site_packages argument from the pip tasks as they are unnecessary given that the virtualenv is created in an earlier task. Change-Id: Ia9e2f695212b01a54f8e73fbd03faa8e9b492f93 --- tasks/python_venv_build.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tasks/python_venv_build.yml b/tasks/python_venv_build.yml index 40989cd..ff73653 100644 --- a/tasks/python_venv_build.yml +++ b/tasks/python_venv_build.yml @@ -47,6 +47,23 @@ args: creates: "{{ venv_install_destination_path }}/bin/activate" +- name: Upgrade pip/setuptools/wheel to the versions we want + pip: + name: + - pip + - setuptools + - wheel + state: "{{ venv_pip_package_state }}" + virtualenv: "{{ venv_install_destination_path }}" + extra_args: >- + --find-links {{ venv_build_wheel_path }}/ + --log /var/log/python_venv_build.log + {{ venv_pip_install_args }} + register: _update_virtualenv_packages + until: _update_virtualenv_packages is success + retries: 5 + delay: 2 + - name: Build wheels for the packages to be installed into the venv command: >- {{ venv_install_destination_path }}/bin/pip wheel @@ -63,7 +80,6 @@ name: "{{ venv_pip_packages }}" state: "{{ venv_pip_package_state }}" virtualenv: "{{ venv_install_destination_path }}" - virtualenv_site_packages: "no" virtualenv_python: "{{ venv_python_executable }}" extra_args: >- --find-links {{ venv_build_wheel_path }}/