From 76909d15997aa2280933e5db6cb4115c8185a3ef Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 7 Dec 2025 17:09:29 +1100 Subject: [PATCH 1/4] Fix Python deprecation warnings during build (Issue #2306) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove deprecated codecs.open() import from setup.py (Python 3.14+) - Replace setup.py install with pip install to avoid SetuptoolsDeprecationWarning - Use pip's modern installation interface instead of deprecated distutils commands - Fixes warnings: 'Please avoid running setup.py directly' and 'codecs.open() is deprecated' 🤖 Generated with Claude Code Co-Authored-By: Claude --- src/python/GNUmakefile | 2 +- src/python/setup.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/python/GNUmakefile b/src/python/GNUmakefile index a78ebcc4318..bb2218e5c1d 100644 --- a/src/python/GNUmakefile +++ b/src/python/GNUmakefile @@ -65,7 +65,7 @@ build_python3: $(SETUP_PY) $(CFILES) touch build_python3 install_python3: build_python3 - export $(ENV); $(PYTHON3) $(SETUP_PY) install $(PY3_INSTALL_OPTS) + export $(ENV); $(PYTHON3) -m pip install --no-build-isolation --root="$${DIST_ROOT:-/}" --prefix=$(PYTHON_PREFIX) . export $(ENV); $(PYTHON3_INSTALL) else build_python3: diff --git a/src/python/setup.py b/src/python/setup.py index 0f9def6cf27..12f3cf33427 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -19,8 +19,6 @@ # New way, modern setup mechanisms for pypi from setuptools import setup, find_packages, Extension -# To use a consistent encoding -from codecs import open from os import path # Get the long description from the README file From 7867415a266cd0f5ab32fdf87cdaa46944815d23 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 8 Dec 2025 10:05:44 +1100 Subject: [PATCH 2/4] Add python3-pip to build dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes CI build failures by ensuring pip module is available for python3 -m pip install command. The original PR #2427 changed from setup.py install to pip install to avoid deprecation warnings, but pip wasn't installed in most CI environments. This adds python3-pip to the package manifest for all supported platforms (dpkg, rpm, emerge, pkgin, pkg_add, F_pkg, S_pkg, slackpkg, pacman, brew). Verified package availability: - Ubuntu 18.04+: python3-pip (pip 9.0.1+) - Debian 11+: python3-pip (pip 20.3.4+) - CentOS Stream 8+: python3-pip - Fedora 42+: python3-pip (pip 24.3.1+) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- qa/admin/other-packages/manifest | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qa/admin/other-packages/manifest b/qa/admin/other-packages/manifest index 7c284b092cd..21cb5f6fdae 100644 --- a/qa/admin/other-packages/manifest +++ b/qa/admin/other-packages/manifest @@ -460,6 +460,17 @@ S_pkg? /usr/lib/python3.*/*-packages/setuptools/dist.py [library/python/setuptoo slackpkg? /usr/lib*/python*/*-packages/setuptools/dist.py [python-setuptools] pacman? /usr/lib/python3.*/*-packages/setuptools/dist.py [extra/python-setuptools] brew? /usr/local/lib/python3.*/*-packages/setuptools/dist.py [pip3(setuptools)] +# -- python pip +dpkg? /usr/bin/pip3 [python3-pip] +rpm? /usr/bin/pip3 [python3-pip or python3[0-9]*-pip] +emerge? /usr/bin/pip3 [dev-python/pip] +pkgin? /usr/pkg/bin/pip3 [py3[0-9]*-pip] +pkg_add? /usr/local/bin/pip3 [py3-pip] +F_pkg? /usr/local/bin/pip3 [py3[0-9]*-pip] +S_pkg? /usr/bin/pip3 [library/python/pip-[0-9][0-9]*] +slackpkg? /usr/bin/pip3 [python-pip] +pacman? /usr/bin/pip3 [extra/python-pip] +brew? /usr/local/bin/pip3 [pip3(pip)] # -- python libvirt and lxml for libvirt PMDA dpkg? /usr/lib/python3/*-packages/libvirt.py [python3-libvirt (build optional)] rpm? /usr/lib*/python3.*/*-packages/libvirt.py [libvirt-python3 or python3[0-9]*-libvirt python3[0-9]*-libvirt-python (build optional)] From 11d46bdfcea29bf0474f07b52f118af384c890f5 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 8 Dec 2025 11:13:42 +1100 Subject: [PATCH 3/4] Add python3-pip to CI package lists The previous commit added python3-pip to the manifest but didn't update the static package list files used by CI. The CI workflows use list-packages with -x pip3 which was intended to exclude Python packages that need pip install (tagged as "pip3"), but python3-pip is a system package that should be installed via the system package manager. This adds python3-pip to all affected platform package lists: - Ubuntu 18.04, 20.04, 22.04, 24.04 (x86_64 and i686) - Debian 11, 12, 13 (x86_64, i686, aarch64) - CentOS Stream 8, 9, 10 (x86_64) Without python3-pip installed, the build fails with: /usr/bin/python3: No module named pip --- qa/admin/package-lists/CentOS+Stream10+x86_64 | 1 + qa/admin/package-lists/CentOS+Stream8+x86_64 | 1 + qa/admin/package-lists/CentOS+Stream9+x86_64 | 1 + qa/admin/package-lists/Debian+11+i686 | 1 + qa/admin/package-lists/Debian+11+x86_64 | 1 + qa/admin/package-lists/Debian+12+aarch64 | 1 + qa/admin/package-lists/Debian+12+i686 | 1 + qa/admin/package-lists/Debian+12+x86_64 | 1 + qa/admin/package-lists/Debian+13+i686 | 1 + qa/admin/package-lists/Debian+13+x86_64 | 1 + qa/admin/package-lists/Ubuntu+18.04+i686 | 1 + qa/admin/package-lists/Ubuntu+18.04+x86_64 | 1 + qa/admin/package-lists/Ubuntu+20.04+x86_64 | 1 + qa/admin/package-lists/Ubuntu+22.04+x86_64 | 1 + qa/admin/package-lists/Ubuntu+24.04+x86_64 | 1 + 15 files changed, 15 insertions(+) diff --git a/qa/admin/package-lists/CentOS+Stream10+x86_64 b/qa/admin/package-lists/CentOS+Stream10+x86_64 index b211b0a585c..06d5022f828 100644 --- a/qa/admin/package-lists/CentOS+Stream10+x86_64 +++ b/qa/admin/package-lists/CentOS+Stream10+x86_64 @@ -103,6 +103,7 @@ python3-libs python3-libvirt python3-lxml python3-openpyxl +python3-pip python3-pandas python3-pillow python3-prometheus_client diff --git a/qa/admin/package-lists/CentOS+Stream8+x86_64 b/qa/admin/package-lists/CentOS+Stream8+x86_64 index fc665731819..6214aed89df 100644 --- a/qa/admin/package-lists/CentOS+Stream8+x86_64 +++ b/qa/admin/package-lists/CentOS+Stream8+x86_64 @@ -99,6 +99,7 @@ python3-libs python3-libvirt python3-lxml python3-openpyxl +python3-pip python3-pillow python3-prometheus_client python3-psycopg2 diff --git a/qa/admin/package-lists/CentOS+Stream9+x86_64 b/qa/admin/package-lists/CentOS+Stream9+x86_64 index 0bb261dc1ea..40aee62b9d8 100644 --- a/qa/admin/package-lists/CentOS+Stream9+x86_64 +++ b/qa/admin/package-lists/CentOS+Stream9+x86_64 @@ -104,6 +104,7 @@ python3-libs python3-libvirt python3-lxml python3-openpyxl +python3-pip python3-pillow python3-prometheus_client python3-psycopg2 diff --git a/qa/admin/package-lists/Debian+11+i686 b/qa/admin/package-lists/Debian+11+i686 index 22d6e7d78ed..609cf5c6d4f 100644 --- a/qa/admin/package-lists/Debian+11+i686 +++ b/qa/admin/package-lists/Debian+11+i686 @@ -107,6 +107,7 @@ python3-elasticsearch python3-libvirt python3-lxml python3-openpyxl +python3-pip python3-pil python3-prometheus-client python3-psycopg2 diff --git a/qa/admin/package-lists/Debian+11+x86_64 b/qa/admin/package-lists/Debian+11+x86_64 index 09c84659774..4a6f86fe664 100644 --- a/qa/admin/package-lists/Debian+11+x86_64 +++ b/qa/admin/package-lists/Debian+11+x86_64 @@ -112,6 +112,7 @@ python3-elasticsearch python3-libvirt python3-lxml python3-openpyxl +python3-pip python3-pil python3-prometheus-client python3-psycopg2 diff --git a/qa/admin/package-lists/Debian+12+aarch64 b/qa/admin/package-lists/Debian+12+aarch64 index 723e2e6520b..f7d5642f33c 100644 --- a/qa/admin/package-lists/Debian+12+aarch64 +++ b/qa/admin/package-lists/Debian+12+aarch64 @@ -112,6 +112,7 @@ python3-libvirt python3-lxml python3-minimal python3-openpyxl +python3-pip python3-pil python3-prometheus-client python3-psycopg2 diff --git a/qa/admin/package-lists/Debian+12+i686 b/qa/admin/package-lists/Debian+12+i686 index 785cc600ac6..cf12e6474d2 100644 --- a/qa/admin/package-lists/Debian+12+i686 +++ b/qa/admin/package-lists/Debian+12+i686 @@ -113,6 +113,7 @@ python3-libvirt python3-lxml python3-minimal python3-openpyxl +python3-pip python3-pandas python3-pil python3-prometheus-client diff --git a/qa/admin/package-lists/Debian+12+x86_64 b/qa/admin/package-lists/Debian+12+x86_64 index 1e0c3083653..d5071dd00e6 100644 --- a/qa/admin/package-lists/Debian+12+x86_64 +++ b/qa/admin/package-lists/Debian+12+x86_64 @@ -118,6 +118,7 @@ python3-libvirt python3-lxml python3-minimal python3-openpyxl +python3-pip python3-pandas python3-pil python3-prometheus-client diff --git a/qa/admin/package-lists/Debian+13+i686 b/qa/admin/package-lists/Debian+13+i686 index 8c2d252900c..e065ee72031 100644 --- a/qa/admin/package-lists/Debian+13+i686 +++ b/qa/admin/package-lists/Debian+13+i686 @@ -119,6 +119,7 @@ python3-elasticsearch python3-libvirt python3-lxml python3-openpyxl +python3-pip python3-pandas python3-pil python3-prometheus-client diff --git a/qa/admin/package-lists/Debian+13+x86_64 b/qa/admin/package-lists/Debian+13+x86_64 index 19aca6f48a6..30d1aa630c6 100644 --- a/qa/admin/package-lists/Debian+13+x86_64 +++ b/qa/admin/package-lists/Debian+13+x86_64 @@ -116,6 +116,7 @@ python3-elasticsearch python3-libvirt python3-lxml python3-openpyxl +python3-pip python3-pil python3-prometheus-client python3-psycopg2 diff --git a/qa/admin/package-lists/Ubuntu+18.04+i686 b/qa/admin/package-lists/Ubuntu+18.04+i686 index 31baaa95c54..4b9c3e9589c 100644 --- a/qa/admin/package-lists/Ubuntu+18.04+i686 +++ b/qa/admin/package-lists/Ubuntu+18.04+i686 @@ -107,6 +107,7 @@ python3-elasticsearch python3-libvirt python3-lxml python3-openpyxl +python3-pip python3-pil python3-prometheus-client python3-psycopg2 diff --git a/qa/admin/package-lists/Ubuntu+18.04+x86_64 b/qa/admin/package-lists/Ubuntu+18.04+x86_64 index 4a01849ad22..96073aa07a7 100644 --- a/qa/admin/package-lists/Ubuntu+18.04+x86_64 +++ b/qa/admin/package-lists/Ubuntu+18.04+x86_64 @@ -108,6 +108,7 @@ python3-elasticsearch python3-libvirt python3-lxml python3-openpyxl +python3-pip python3-pil python3-prometheus-client python3-psycopg2 diff --git a/qa/admin/package-lists/Ubuntu+20.04+x86_64 b/qa/admin/package-lists/Ubuntu+20.04+x86_64 index f030fc825c8..8004e2bfd5c 100644 --- a/qa/admin/package-lists/Ubuntu+20.04+x86_64 +++ b/qa/admin/package-lists/Ubuntu+20.04+x86_64 @@ -115,6 +115,7 @@ python3-libvirt python3-lxml python3-minimal python3-openpyxl +python3-pip python3-pandas python3-pil python3-prometheus-client diff --git a/qa/admin/package-lists/Ubuntu+22.04+x86_64 b/qa/admin/package-lists/Ubuntu+22.04+x86_64 index d0403303a18..7855a4f3a8f 100644 --- a/qa/admin/package-lists/Ubuntu+22.04+x86_64 +++ b/qa/admin/package-lists/Ubuntu+22.04+x86_64 @@ -116,6 +116,7 @@ python3-libvirt python3-lxml python3-minimal python3-openpyxl +python3-pip python3-pil python3-prometheus-client python3-psycopg2 diff --git a/qa/admin/package-lists/Ubuntu+24.04+x86_64 b/qa/admin/package-lists/Ubuntu+24.04+x86_64 index d99343e9c59..0da5f1382e0 100644 --- a/qa/admin/package-lists/Ubuntu+24.04+x86_64 +++ b/qa/admin/package-lists/Ubuntu+24.04+x86_64 @@ -118,6 +118,7 @@ python3-libvirt python3-lxml python3-minimal python3-openpyxl +python3-pip python3-pandas python3-pil python3-prometheus-client From 4be83552d1bd6a690f2e1b56586abed9dce202dc Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 8 Dec 2025 14:59:16 +1100 Subject: [PATCH 4/4] Add --record flag to pip install for python3-pcp.list generation The previous fix added 'python3 -m pip install' but didn't include the --record flag that was present in the old PY3_INSTALL_OPTS. This flag creates the python3-pcp.list file which is required by debian/post-auto-install for packaging. Without this file, the debian build fails with: post-auto-install: Error: python3-pcp expects ../python3-pcp.list --- src/python/GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/GNUmakefile b/src/python/GNUmakefile index bb2218e5c1d..595e8c8a19b 100644 --- a/src/python/GNUmakefile +++ b/src/python/GNUmakefile @@ -65,7 +65,7 @@ build_python3: $(SETUP_PY) $(CFILES) touch build_python3 install_python3: build_python3 - export $(ENV); $(PYTHON3) -m pip install --no-build-isolation --root="$${DIST_ROOT:-/}" --prefix=$(PYTHON_PREFIX) . + export $(ENV); $(PYTHON3) -m pip install --no-build-isolation --root="$${DIST_ROOT:-/}" --prefix=$(PYTHON_PREFIX) --record=$(TOPDIR)/python3-pcp.list . export $(ENV); $(PYTHON3_INSTALL) else build_python3: