Merge "Remove use of pkg_resources"

This commit is contained in:
Zuul
2025-11-04 14:31:22 +00:00
committed by Gerrit Code Review
2 changed files with 2 additions and 3 deletions

View File

@@ -273,8 +273,7 @@ function use_library_from_git {
function lib_installed_from_git {
local name=$1
local safe_name
safe_name=$(python -c "from pkg_resources import safe_name; \
print(safe_name('${name}'))")
safe_name=$(python -c "from packaging import canonicalize_name; print(canonicalize_name('${name}'))")
# Note "pip freeze" doesn't always work here, because it tries to
# be smart about finding the remote of the git repo the package
# was installed from. This doesn't work with zuul which clones

View File

@@ -84,7 +84,7 @@ EOF
# python3-setuptools RPM are deleted, it breaks some tools such as semanage
# (used in diskimage-builder) that use the -s flag of the python
# interpreter, enforcing the use of the packages from /usr/lib.
# Importing setuptools/pkg_resources in a such environment fails.
# Importing setuptools in a such environment fails.
# Enforce the package re-installation to fix those applications.
if is_package_installed python3-setuptools; then
sudo dnf reinstall -y python3-setuptools