Remove libvirt-python from upper-constraints

... when installed from distribution.

This is mostly to fix Ironic's gate as their ecosystem is too
broad and complex to quickly remove libvirt-python from all
possible requirements.txt

More details inline.

See also: https://review.opendev.org/c/openstack/devstack/+/798514
aka f0bf2bdff1

Change-Id: Ic44daf15e952bbe3c424984ffb2474261e68008f
(cherry picked from commit 8b8a4c75b7)
This commit is contained in:
Radosław Piliszek 2021-08-18 15:00:09 +00:00 committed by Dr. Jens Harbott
parent e2bed1b72f
commit d6382fbece
1 changed files with 11 additions and 0 deletions

View File

@ -56,6 +56,17 @@ EOF
# Installs required distro-specific libvirt packages.
function install_libvirt {
# NOTE(yoctozepto): The common consensus [1] is that libvirt-python should
# be installed from distro packages. However, various projects might be
# trying to ensure it is installed using pip AND use upper-constraints
# with that, causing pip to try to upgrade it and to fail.
# The following line removes libvirt-python from upper-constraints and
# avoids the situation described above. Now only if installed packages
# explicitly depend on a newer (or, in general, incompatible) libvirt-python
# version, will pip try to reinstall it.
# [1] https://review.opendev.org/c/openstack/devstack/+/798514
$REQUIREMENTS_DIR/.venv/bin/edit-constraints \
$REQUIREMENTS_DIR/upper-constraints.txt -- libvirt-python
if is_ubuntu; then
install_package qemu-system libvirt-clients libvirt-daemon-system libvirt-dev python3-libvirt