Remove use of pkg_resources

Change-Id: I5d0697f39bab0a5ff956c3cc41c26ffe601ef6b9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane
2025-10-31 17:09:11 +00:00
parent 2801938292
commit eee708742a
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