4 Commits

Author SHA1 Message Date
Dariusz Smigiel
1f76342ccf Pull correct upstream pip version
Recent release of pip removed support for Python 3.6 [1]

Configure default url for pip, depending on supported
Python version.

[1]: https://pip.pypa.io/en/stable/news/#v22-0

Change-Id: I01faeba1dff864de31b3bbf9ddbe0a4d454fdbe9
2022-02-01 08:33:58 -08:00
Sean McGinnis
09b4be329e
Strip path from default ensure_pip_from_upstream_interpreters
The ensure-pip role has an option to provide multiple interpreters to
use. If not specified, we default to ansible_python.executable. This
default includes the full path to the executable. Those manually
providing which interpreters to use will not know what the full path is,
only the versions they would like to use. To make things consistent,
this strips off the path so we just have the version (python, python3,
python3.8, etc).

Change-Id: I339afc08393e9c6b1d26a05cf13b6fdc151f46d5
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-07-10 11:24:27 -05:00
Ian Wienand
b4c195b419 ensure-pip: use python2-pip when running under Python 2
When Ansible runs under Python 2, such as on SuSE 15, we need
python2-pip for pip: to work.  Update the default to install Python 2
deps when Ansible is running under v2.

Additionally for SuSE, as described inline we can have pip but not
setuptools.  Put in a work-around to always pull in the setuptools
package.  Pull this out into a separate file; history has shown that
we may need more :/

Change-Id: I450171aad5e31d2925239ab3d0641cd23f6815a2
2020-05-05 09:27:24 +10:00
Ian Wienand
5068744eff ensure-pip: Add role
This role is intended to ensure that the `pip:` module, and jobs that
may wish to use `pip` from the shell, have the necessary requirements.

It is intended as a partial replacement for the pip-and-virtualenv
element in diskimage-builder, which currently pre-installs pip on our
infra CI images during image build.

We wish to remain broady compatible with this element, but not
replicate some of the more problematic areas of its implementation.

By default, this installs the system packages for pip and setuptools
(the latter being a requirement of the Ansible pip module, which
imports it directly, despite pip itself not requiring it).

In this role, we ensure the libraries for the currently running
ansible_python_interpreter version are installed.

There is provision to provide a flag to install the packages directly
from upstream via get-pip.py, although this is not recommended.

Story: #2007386
Task: #39309

Change-Id: Iac2d518a66caf1b801273225f75a0a748412903c
2020-04-14 10:20:33 +10:00