Skip to content

Commit b0146a2

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Remove use of pkg_resources"
2 parents 55f4dab + eee7087 commit b0146a2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

inc/python

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ function use_library_from_git {
273273
function lib_installed_from_git {
274274
local name=$1
275275
local safe_name
276-
safe_name=$(python -c "from pkg_resources import safe_name; \
277-
print(safe_name('${name}'))")
276+
safe_name=$(python -c "from packaging import canonicalize_name; print(canonicalize_name('${name}'))")
278277
# Note "pip freeze" doesn't always work here, because it tries to
279278
# be smart about finding the remote of the git repo the package
280279
# was installed from. This doesn't work with zuul which clones

tools/fixup_stuff.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ EOF
8484
# python3-setuptools RPM are deleted, it breaks some tools such as semanage
8585
# (used in diskimage-builder) that use the -s flag of the python
8686
# interpreter, enforcing the use of the packages from /usr/lib.
87-
# Importing setuptools/pkg_resources in a such environment fails.
87+
# Importing setuptools in a such environment fails.
8888
# Enforce the package re-installation to fix those applications.
8989
if is_package_installed python3-setuptools; then
9090
sudo dnf reinstall -y python3-setuptools

0 commit comments

Comments
 (0)