6dce7ba605
This makes ensure-pip export something that should be sensible for users of pip: to put in their 'virtualenv_command' for their host. The theory of operation is fairly simple; see if "python3 -m venv" looks like it works, and set that as the command if it does. If not, set "virtualenv". For sanity, we check if it works. We pull in virtualenv in the Python 2 case, but for Python 3 we are deliberately do not bring it as it is an unnecessary dependency. If jobs do require the actual `virtualenv` package, they should provision it themselves ... except for Xenial, which, as described inline, has issues. Follow-on changes will convert existing zuul-jobs roles that install tools into virtualenvs to use this argument. Change-Id: Idad14c0e77eed5bf8df2c8f84f52fbdea2236a9f
17 lines
337 B
YAML
17 lines
337 B
YAML
- name: Install Python 3 pip
|
|
package:
|
|
name:
|
|
- python3-pip
|
|
- python3-setuptools
|
|
- python3-venv
|
|
become: yes
|
|
|
|
- name: Install Python 2 pip
|
|
package:
|
|
name:
|
|
- python-setuptools
|
|
- python-pip
|
|
become: yes
|
|
when: (ensure_pip_from_packages_with_python2) or
|
|
(ansible_python.version.major == 2)
|