From 9f49737381052e8eaeb262999643f9d49dda3270 Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Wed, 2 Apr 2025 17:01:03 -0500 Subject: [PATCH] Use python3 venv module instead of virtualenv We install virtualenv module using apt package python3-virtualenv. The Ubuntu Jammy version of this package is not compatible with the Openstack 2025.1 (requirements/upper-constrains.txt:platformdirs===4.3.6). Venv module is part of the standard Python3 distribution since 3.3 and we don't need it to be compatible with Python2. Let's use it instead of virtualenv. Change-Id: Ic70af615ef42d69a4055998130487a5ed10d2232 --- Dockerfile | 1 - scripts/install.sh | 2 +- scripts/setup_pip.sh | 7 +------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 934766b5..4d841476 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,6 @@ ARG SPICE_REF=spice-html5-0.1.6 # Virtualenv arguments -ARG GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py" ARG PIP_CONSTRAINT="" ARG SETUPTOOL_CONSTRAINT="" ARG WHEEL_CONSTRAIN="" diff --git a/scripts/install.sh b/scripts/install.sh index 1a7315f7..447cfc61 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -10,7 +10,7 @@ if [[ ${distro} == "ubuntu" ]]; then fi export distro_version=${DISTRO_VERSION:=$distro_version} -dpkg_python_packages=("python3" "python3-virtualenv") +dpkg_python_packages=("python3" "python3-venv") rpm_python_packages=("python3") case ${distro} in diff --git a/scripts/setup_pip.sh b/scripts/setup_pip.sh index 94e92b23..a681c37b 100755 --- a/scripts/setup_pip.sh +++ b/scripts/setup_pip.sh @@ -5,19 +5,14 @@ set -ex PIP_CONSTRAINT=${PIP_CONSTRAINT} SETUPTOOL_CONSTRAINT=${SETUPTOOL_CONSTRAINT} WHEEL_CONSTRAIN=${WHEEL_CONSTRAIN} -VIRTUALENV="python3 -m virtualenv --python=python3 --no-seed" - -wget $GET_PIP_URL -O /tmp/get-pip.py # Create the virtualenv with the updated toolchain for openstack service # for using python-rbd which is not pip installable and is only available # in packaged form. -$VIRTUALENV --system-site-packages --extra-search-dir=/tmp/wheels /var/lib/openstack +python3 -m venv --system-site-packages /var/lib/openstack source /var/lib/openstack/bin/activate -python /tmp/get-pip.py - pip install --upgrade pip${PIP_CONSTRAINT} pip install --upgrade setuptools${SETUPTOOL_CONSTRAINT} pip install --upgrade wheel${WHEEL_CONSTRAIN}