From de007a80af302888c98bbc36902c62aea915ed37 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Fri, 29 Oct 2021 10:47:31 +0200 Subject: [PATCH] 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 --- .../60-ironic-python-agent-ramdisk-install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install b/dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install index f2ad8cd..e863b1b 100755 --- a/dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install +++ b/dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install @@ -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 \