Associate pip version to python version in DIB based images

Use current latest version of pip for Python 3.x

For Python 2.x use the last pip version to support it [1].

[1] https://pypi.org/project/pip/20.3.4/

Change-Id: I7384beb16d3810ddede51e6e2660bb826bd47415
This commit is contained in:
Riccardo Pittau 2021-10-29 10:47:31 +02:00
parent bffece3c14
commit de007a80af
1 changed files with 5 additions and 3 deletions

View File

@ -13,9 +13,6 @@ IPADIR=/tmp/ironic-python-agent
IRLIBDIR=/tmp/ironic-lib
UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
VENVDIR=/opt/ironic-python-agent
# 19.1.1 is required for cryptography.
REQUIRED_PIP_STR="19.1.1"
REQUIRED_PIP_TUPLE="(19, 1, 1)"
IPA_PYTHON_VERSION=$DIB_PYTHON_VERSION
IPA_PYTHON="$DIB_PYTHON"
@ -37,8 +34,13 @@ esac
# create the virtual environment using the default python
if [ $IPA_PYTHON_VERSION == 3 ]; then
$IPA_PYTHON -m venv $VENVDIR
REQUIRED_PIP_STR="21.3.1"
REQUIRED_PIP_TUPLE="(21, 3, 1)"
else
$IPA_PYTHON -m virtualenv $VENVDIR
# NOTE(rpittau) pip 20.3.4 is the last version to support Python 2.x
REQUIRED_PIP_STR="20.3.4"
REQUIRED_PIP_TUPLE="(20, 3, 4)"
fi
HAS_PIP=$($VENVDIR/bin/python -c \