[Stable-Only] Pin setuptools

setuptools 81.0.0 dropped support for the legacy 'pkg_resources'
library. While most users of this (including the all important pbr
library) have been updated to remove references to 'pkg_resources' on
current master, this is not true for historical releases. Pin the
setuptools version used on these historic branches to work around this.

Conflicts:
    inc/python

NOTE(stephenfin): Conflicts are due to the absence of
I74b0f93457f91e7d53d54737d52f67075088faca which we don't want to
backport

Change-Id: Icf07fa246b3532f939d20e3cbea32cc0b7b439ed
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
(cherry picked from commit 94e1ba49e9)
(cherry picked from commit 84c7dd2354)
This commit is contained in:
Stephen Finucane
2026-02-09 11:41:14 +00:00
parent 978a231b10
commit 24345ce579
2 changed files with 5 additions and 2 deletions

View File

@@ -45,10 +45,11 @@ function setup_devstack_virtualenv {
# versions of pip which removed support for legacy editable installs
# [1]. Some services on this stable branch still hadn't migrated to
# module-based configuration [2]. This is not an issue since 2025.2.
# We also pin setuptools to the last version to support pkg_resources.
#
# [1] https://pip.pypa.io/en/stable/news/#v25-3
# [2] https://review.opendev.org/c/openstack/governance/+/902807
pip_install -U 'pip<25.3' setuptools[core]
pip_install -U 'pip<25.3' 'setuptools[core]<81.0.0'
#NOTE(rpittau): workaround for simplejson removal in osc
# https://review.opendev.org/c/openstack/python-openstackclient/+/920001
pip_install -U simplejson

View File

@@ -31,7 +31,9 @@ function install_infra {
local PIP_VIRTUAL_ENV="$REQUIREMENTS_DIR/.venv"
[ ! -d $PIP_VIRTUAL_ENV ] && ${VIRTUALENV_CMD} $PIP_VIRTUAL_ENV
# We don't care about testing git pbr in the requirements venv.
PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install -U pbr setuptools[core]
# NOTE(stephenfin) stable-only change to pin setuptools to the last version
# to support pkg_resources
PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install -U pbr 'setuptools[core]<81.0.0'
PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install $REQUIREMENTS_DIR
# Unset the PIP_VIRTUAL_ENV so that PBR does not end up trapped