From 237406dfa9e9a9876020ba3248ce218151c21765 Mon Sep 17 00:00:00 2001 From: yezengruan Date: Tue, 29 Mar 2022 17:24:07 +0800 Subject: [PATCH] Avoid truncating python version number when running sanity test Signed-off-by: yezengruan --- ...-python-version-number-when-running-.patch | 35 +++++++++++++++++++ libvirt-python.spec | 6 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 Avoid-truncating-python-version-number-when-running-.patch diff --git a/Avoid-truncating-python-version-number-when-running-.patch b/Avoid-truncating-python-version-number-when-running-.patch new file mode 100644 index 0000000..a5815ef --- /dev/null +++ b/Avoid-truncating-python-version-number-when-running-.patch @@ -0,0 +1,35 @@ +From 991ecb5de8c8603747a294efa980ec45e4f589d1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Thu, 12 Nov 2020 13:34:14 +0000 +Subject: [PATCH] Avoid truncating python version number when running sanity + test +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The current code assumes the version number string will be only three +characters long, which fails with "3.10". + +Signed-off-by: Daniel P. Berrangé +--- + setup.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 5336551..e564fd8 100755 +--- a/setup.py ++++ b/setup.py +@@ -283,7 +283,9 @@ class my_test(Command): + if self.plat_name is None: + self.plat_name = get_platform() + +- plat_specifier = ".%s-%s" % (self.plat_name, sys.version[0:3]) ++ plat_specifier = ".%s-%d.%d" % (self.plat_name, ++ sys.version_info[0], ++ sys.version_info[1]) + + if hasattr(sys, 'gettotalrefcount'): + plat_specifier += '-pydebug' +-- +2.27.0 + diff --git a/libvirt-python.spec b/libvirt-python.spec index 6fa0da7..d5b3b90 100644 --- a/libvirt-python.spec +++ b/libvirt-python.spec @@ -3,7 +3,7 @@ Summary: The libvirt virtualization API python3 binding Name: libvirt-python Version: 6.2.0 -Release: 2 +Release: 3 Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz Patch0000: setup-use-pytest-instead-of-nose-to-run-the-test-sui.patch Patch0001: spec-use-pytest-instead-of-nose.patch @@ -11,6 +11,7 @@ Patch0002: Update-readme-to-mention-pytest-instead-of-nose.patch Patch0003: Fix-PY_SSIZE_T_CLEAN-deprecation-warning.patch Patch0004: Avoid-use-of-thread-function-deprecated-in-3.9.patch Patch0005: Replace-deprecated-PyEval_CallObject-with-PyObject_C.patch +Patch0006: Avoid-truncating-python-version-number-when-running-.patch Url: http://libvirt.org License: LGPLv2+ BuildRequires: libvirt-devel == %{version} @@ -75,6 +76,9 @@ find examples -type f -exec chmod 0644 \{\} \; %{python3_sitearch}/*egg-info %changelog +* Thu Mar 29 2022 yezengruan - 6.2.0-3 +- Avoid truncating python version number when running sanity test + * Tue Jan 11 2022 imxcc - 6.2.0-2 - setup: use pytest instead of nose to run the test suite - spec: use pytest instead of nose -- Gitee