Remove PYTHON3

The python2 is long dead and the PYTHON3 flag has been noop for a while.

Change-Id: Ia7be53e84090cc8b80e1dd5753ba1460ff454851
Related-Id: I3f4f60756887ad07229cf522803b30d4e16463cd
This commit is contained in:
Sam Yaple 2022-09-21 13:57:59 -04:00
parent 361fd6e104
commit 4ff506ae5c
6 changed files with 18 additions and 35 deletions

View File

@ -7,14 +7,13 @@ ARG WHEELS=loci/requirements:master-ubuntu
ARG PROJECT_REPO=https://opendev.org/openstack/${PROJECT}
ARG PROJECT_REF=master
ARG PROJECT_RELEASE=master
ARG DISTRO
ARG PROFILES
ARG DISTRO=""
ARG PROFILES=""
ARG PIP_PACKAGES=""
ARG PIP_ARGS=""
ARG PIP_WHEEL_ARGS=$PIP_ARGS
ARG DIST_PACKAGES=""
ARG PLUGIN=no
ARG PYTHON3=indeed
ARG EXTRA_BINDEP=""
ARG EXTRA_PYDEP=""
ARG REGISTRY_PROTOCOL="detect"

View File

@ -34,7 +34,7 @@ kvm [platform:rpm (infra libvirt)]
lapack-devel [platform:rpm requirements]
libapache2-mod-auth-mellon [platform:dpkg (keystone apache mellon)]
libapache2-mod-auth-openidc [platform:dpkg (keystone apache openidc)]
libapache2-mod-wsgi-py3 [platform:dpkg (apache python3)]
libapache2-mod-wsgi-py3 [platform:dpkg apache]
libblas-dev [platform:dpkg requirements]
liberasurecode-dev [platform:dpkg requirements]
liberasurecode-devel [platform:rpm requirements]
@ -54,6 +54,8 @@ libosinfo [platform:rpm nova]
libosinfo-bin [platform:dpkg nova]
libpcre3-dev [platform:dpkg requirements]
libpq-dev [platform:dpkg requirements]
# libpythonx.y installation logic is moved to scripts to be able to dynamically
# determine minor version from default python installed in a system.
librdkafka-dev [platform:dpkg requirements]
libreswan [platform:rpm (neutron vpn)]
libsasl2-dev [platform:dpkg requirements]
@ -99,11 +101,12 @@ pkg-config [platform:dpkg requirements]
pkgconfig [platform:rpm requirements]
postgresql-devel [platform:rpm requirements]
postgresql-server-devel [platform:suse requirements]
python3-dev [platform:dpkg (requirements python3)]
python3-devel [platform:rpm (requirements python3)]
python3-mysqldb [platform:dpkg (monasca api python3)]
python3-rados [platform:dpkg (glance ceph python3) (cinder ceph python3) (manila ceph python3) (nova ceph python3)]
python3-rbd [platform:dpkg platform:rpm (glance ceph python3) (cinder ceph python3) (manila ceph python3) (nova ceph python3)]
python-mysql [platform:rpm (monasca api)]
python3-dev [platform:dpkg requirements]
python3-devel [platform:rpm requirements]
python3-mysqldb [platform:dpkg (monasca api)]
python3-rados [platform:dpkg (glance ceph) (cinder ceph) (manila ceph) (nova ceph)]
python3-rbd [(glance ceph) (cinder ceph) (manila ceph) (nova ceph)]
qemu [platform:dpkg (infra libvirt)]
qemu-img [platform:rpm (nova qemu) (ironic qemu) (cinder qemu) (glance qemu)]
qemu-utils [platform:dpkg (nova qemu) (ironic qemu) (cinder qemu) (glance qemu)]

View File

@ -80,4 +80,3 @@ distros:
FROM: base:ubuntu_bionic
PROJECT_REF: "stable/ussuri"
PROJECT_RELEASE: "ussuri"
PYTHON3: yes

View File

@ -5,23 +5,14 @@ set -ex
distro=$(awk -F= '/^ID=/ {gsub(/\"/, "", $2); print $2}' /etc/*release)
export distro=${DISTRO:=$distro}
if [[ "${PYTHON3}" == "no" ]]; then
dpkg_python_packages=("python" "virtualenv")
rpm_python_packages=("python" "python-virtualenv")
python3=""
python_version=2
else
dpkg_python_packages=("python3" "python3-virtualenv")
rpm_python_packages=("python3")
python3="python3"
python_version=3
fi
dpkg_python_packages=("python3" "python3-virtualenv")
rpm_python_packages=("python3")
case ${distro} in
ubuntu)
export LC_CTYPE=C.UTF-8
apt-get update
if [[ ! -z "$(apt-cache search ^${python3}-distutils$)" ]]; then
if [[ ! -z "$(apt-cache search ^python3-distutils$)" ]]; then
dpkg_python_packages+=("python3-distutils")
fi
apt-get upgrade -y
@ -34,8 +25,7 @@ case ${distro} in
sudo \
${dpkg_python_packages[@]}
apt-get install -y --no-install-recommends \
libpython${python_version}.$(python${python_version} -c 'import sys;\
print(sys.version_info.minor);')
libpython3.$(python3 -c 'import sys; print(sys.version_info.minor);')
;;
centos)
export LC_CTYPE=en_US.UTF-8
@ -78,7 +68,7 @@ if [[ "${PLUGIN}" == "no" ]]; then
$(dirname $0)/setup_pip.sh
$(dirname $0)/pip_install.sh bindep
for file in /opt/loci/pydep*; do
PYDEP_PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROJECT_RELEASE} ${PROFILES} ${python3} || :))
PYDEP_PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROJECT_RELEASE} ${PROFILES} || :))
done
$(dirname $0)/pip_install.sh ${PYDEP_PACKAGES[@]}
fi

View File

@ -2,12 +2,8 @@
set -ex
if [[ "${PYTHON3}" != "no" ]]; then
python3=python3
fi
for file in /opt/loci/bindep*; do
PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROFILES} ${python3} || :))
PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROFILES} || :))
done
if [[ ! -z ${PACKAGES} ]]; then

View File

@ -3,11 +3,7 @@
set -ex
if [[ "${PYTHON3}" == "no" ]]; then
TMP_VIRTUALENV="virtualenv"
else
TMP_VIRTUALENV="python3 -m virtualenv --python=python3"
fi
TMP_VIRTUALENV="python3 -m virtualenv --python=python3"
# This little dance allows us to install the latest pip
# without get_pip.py or the python-pip package (in epel on centos)