!34 [sync] PR-32: Update to 9.10.0 release, Initial package for openEuler.

From: @openeuler-sync-bot 
Reviewed-by: @yezengruan 
Signed-off-by: @yezengruan
This commit is contained in:
openeuler-ci-bot 2024-03-26 12:32:02 +00:00 committed by Gitee
commit 474afc760a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
14 changed files with 6 additions and 651 deletions

View File

@ -1,35 +0,0 @@
From 991ecb5de8c8603747a294efa980ec45e4f589d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
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é <berrange@redhat.com>
---
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

View File

@ -1,73 +0,0 @@
From 1cab3de8bc544550bd13926141b3a9a01951f502 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Thu, 12 Nov 2020 13:30:23 +0000
Subject: [PATCH 5/6] Avoid use of thread function deprecated in 3.9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PyEval_ThreadsInitialized was deprecated in 3.9, with deletion targetted
for 3.11. Furthermore since 3.7 it is guaranteed that threads are always
initialized by Py_Initialize(), so checking it is redundant.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
typewrappers.h | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/typewrappers.h b/typewrappers.h
index fc923bf..b197d65 100644
--- a/typewrappers.h
+++ b/typewrappers.h
@@ -255,24 +255,44 @@ PyObject * libvirt_virDomainSnapshotPtrWrap(virDomainSnapshotPtr node);
# endif /* !(__GNUC__ && !__STRICT_ANSI__ && !__cplusplus) */
#endif
-#define LIBVIRT_BEGIN_ALLOW_THREADS \
+#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7
+# define LIBVIRT_BEGIN_ALLOW_THREADS \
LIBVIRT_STMT_START { \
PyThreadState *_save = NULL; \
if (PyEval_ThreadsInitialized()) \
_save = PyEval_SaveThread();
-#define LIBVIRT_END_ALLOW_THREADS \
+# define LIBVIRT_END_ALLOW_THREADS \
if (PyEval_ThreadsInitialized()) \
PyEval_RestoreThread(_save); \
} LIBVIRT_STMT_END
-#define LIBVIRT_ENSURE_THREAD_STATE \
+# define LIBVIRT_ENSURE_THREAD_STATE \
LIBVIRT_STMT_START { \
PyGILState_STATE _save = PyGILState_UNLOCKED; \
if (PyEval_ThreadsInitialized()) \
_save = PyGILState_Ensure();
-#define LIBVIRT_RELEASE_THREAD_STATE \
+# define LIBVIRT_RELEASE_THREAD_STATE \
if (PyEval_ThreadsInitialized()) \
PyGILState_Release(_save); \
} LIBVIRT_STMT_END
+
+#else
+
+# define LIBVIRT_BEGIN_ALLOW_THREADS \
+ LIBVIRT_STMT_START { \
+ PyThreadState *_save = PyEval_SaveThread();
+
+# define LIBVIRT_END_ALLOW_THREADS \
+ PyEval_RestoreThread(_save); \
+ } LIBVIRT_STMT_END
+
+# define LIBVIRT_ENSURE_THREAD_STATE \
+ LIBVIRT_STMT_START { \
+ PyGILState_STATE _save = PyGILState_Ensure();
+
+# define LIBVIRT_RELEASE_THREAD_STATE \
+ PyGILState_Release(_save); \
+ } LIBVIRT_STMT_END
+#endif
--
2.27.0

View File

@ -1,34 +0,0 @@
From 387b95910caf87f8a7bb7d92b5258fc2ef46453d Mon Sep 17 00:00:00 2001
From: qihao <qihao_yewu@cmss.chinamobile.com>
Date: Fri, 17 Mar 2023 11:14:32 +0800
Subject: [PATCH] Fix BlockThreshold Callback argument conversion once more
The conversion was changed from "OssiiO" to "OssLLO". Unfortunately the
arguments are unsigned long long, where the proper coversion character
is 'K'.
Fixes: https://gitlab.com/libvirt/libvirt-python/-/merge_requests/40
Fixes: fd069ac85c8cf1593587dc9287a3d5eb6bd4bdb9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1976109
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: qihao <qihao_yewu@cmss.chinamobile.com>
---
libvirt-override.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index 2b39ace..48dfe4e 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -7231,7 +7231,7 @@ libvirt_virConnectDomainEventBlockThresholdCallback(virConnectPtr conn ATTRIBUTE
/* Call the Callback Dispatcher */
pyobj_ret = PyObject_CallMethod(pyobj_conn,
(char*)"_dispatchDomainEventBlockThresholdCallback",
- (char*)"OssiiO",
+ (char*)"OssKKO",
pyobj_dom, dev, path, threshold, excess,
pyobj_cbData);
--
2.18.2

View File

@ -1,115 +0,0 @@
From ccbe311a4bcb123933499126278ba48aab36427a Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Sun, 5 Jul 2020 12:51:45 -0400
Subject: [PATCH 4/6] Fix PY_SSIZE_T_CLEAN deprecation warning
Seen running on fedora 32:
DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
ret = libvirtmod.virDomainLookupByUUID(self._o, uuid)
This comes from here: https://bugs.python.org/issue36381
See the section about PY_SSIZE_T_CLEAN here:
https://docs.python.org/3/c-api/arg.html#strings-and-buffers
Solution is to use Py_ssize_t instead of int for unpacked '#' values,
combined with defined PY_SSIZE_T_CLEAN before importing Python.h. The
latter turns these deprecation warnings into runtime segfaults though
if we missed an instance.
I verified the virt-manager's test suite works fine after this change
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
libvirt-override.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index 2b39ace..00efe7f 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -17,6 +17,7 @@
/* We want to see *_LAST enums. */
#define VIR_ENUM_SENTINELS
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
@@ -3040,7 +3041,7 @@ libvirt_virDomainLookupByUUID(PyObject *self ATTRIBUTE_UNUSED,
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virDomainLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -3283,7 +3284,7 @@ libvirt_virNetworkLookupByUUID(PyObject *self ATTRIBUTE_UNUSED,
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virNetworkLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -3992,7 +3993,7 @@ libvirt_virStoragePoolLookupByUUID(PyObject *self ATTRIBUTE_UNUSED,
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virStoragePoolLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -4233,7 +4234,7 @@ libvirt_virSecretLookupByUUID(PyObject *self ATTRIBUTE_UNUSED,
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virSecretLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -4393,7 +4394,7 @@ libvirt_virSecretSetValue(PyObject *self ATTRIBUTE_UNUSED,
virSecretPtr secret;
PyObject *pyobj_secret;
const char *value;
- int size;
+ Py_ssize_t size;
unsigned int flags;
if (!PyArg_ParseTuple(args, (char *)"Oz#I:virSecretSetValue", &pyobj_secret,
@@ -4402,8 +4403,8 @@ libvirt_virSecretSetValue(PyObject *self ATTRIBUTE_UNUSED,
secret = (virSecretPtr) PyvirSecret_Get(pyobj_secret);
LIBVIRT_BEGIN_ALLOW_THREADS;
- c_retval = virSecretSetValue(secret, (const unsigned char *)value, size,
- flags);
+ c_retval = virSecretSetValue(secret, (const unsigned char *)value,
+ (size_t) size, flags);
LIBVIRT_END_ALLOW_THREADS;
return libvirt_intWrap(c_retval);
@@ -4471,7 +4472,7 @@ libvirt_virNWFilterLookupByUUID(PyObject *self ATTRIBUTE_UNUSED,
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virNWFilterLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -10247,7 +10248,7 @@ libvirt_virNetworkPortLookupByUUID(PyObject *self ATTRIBUTE_UNUSED,
virNetworkPtr net;
PyObject *pyobj_net;
unsigned char *uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virNetworkPortLookupByUUID",
&pyobj_net, &uuid, &len))
--
2.27.0

View File

@ -1,28 +0,0 @@
From a24c9df52ce15f7ad5742e0693ef6108d7a2ea10 Mon Sep 17 00:00:00 2001
From: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
Date: Thu, 24 Nov 2022 19:59:54 +0800
Subject: [PATCH] generator: Fix string formatting
remove excessive arguments.
Signed-off-by: Philipp Hahn <hahn@univention.de>
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
---
generator.py | 2 +----
1 file changed, 1 insertion(+), 1 deletions(-)
diff --git a/generator.py b/generator.py
index 426f007..5e89136 100755
--- a/generator.py
+++ b/generator.py
@@ -766,7 +766,7 @@ def print_function_wrapper(module, name, output, export, include):
if file == "python_accessor":
if args[1][1] == "char *":
c_call = "\n VIR_FREE(%s->%s);\n" % (
- args[0][0], args[1][0], args[0][0], args[1][0])
+ args[0][0], args[1][0])
c_call = c_call + " %s->%s = (%s)strdup((const xmlChar *)%s);\n" % (args[0][0],
args[1][0], args[1][1], args[1][0])
else:
--
2.18.2

View File

@ -1,27 +0,0 @@
From 787c5e56deede97ede263c104c2e7c54af922d39 Mon Sep 17 00:00:00 2001
From: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
Date: Thu, 24 Nov 2022 19:54:14 +0800
Subject: [PATCH] Fix the invalid "+" operation between incompatible types
Change the ending position of parentheses.
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
---
examples/guest-vcpus/guest-vcpu-daemon.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/guest-vcpus/guest-vcpu-daemon.py b/examples/guest-vcpus/guest-vcpu-daemon.py
index 30fcb9c..211e9d4 100755
--- a/examples/guest-vcpus/guest-vcpu-daemon.py
+++ b/examples/guest-vcpus/guest-vcpu-daemon.py
@@ -103,7 +103,7 @@ def work():
try:
conn = libvirt.open(uri)
except:
- print('Failed to connect to ' + uri + ', retry in ' + str(connectRetryTimeout)) + ' seconds'
+ print('Failed to connect to ' + uri + ', retry in ' + str(connectRetryTimeout) + ' seconds')
time.sleep(connectRetryTimeout)
continue
--
2.18.2

View File

@ -1,95 +0,0 @@
From d966561b118ce9fe159a9a47c3a120e8439004d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Thu, 12 Nov 2020 14:31:54 +0000
Subject: [PATCH 6/6] Replace deprecated PyEval_CallObject with PyObject_Call
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The former is deprecated since Python 3.9, and the latter has existed
for all 3.x and probably before.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
libvirt-override.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index 00efe7f..d1f3ac0 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -1856,7 +1856,7 @@ libvirt_virErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx,
VIR_PY_TUPLE_SET_GOTO(info, 8, libvirt_intWrap((long)err->int2), cleanup);
/* TODO pass conn and dom if available */
- result = PyEval_CallObject(libvirt_virPythonErrorFuncHandler, list);
+ result = PyObject_Call(libvirt_virPythonErrorFuncHandler, list, NULL);
Py_XDECREF(result);
}
@@ -1961,7 +1961,7 @@ virConnectCredCallbackWrapper(virConnectCredentialPtr cred,
VIR_PY_TUPLE_SET_GOTO(list, 1, pycbdata, cleanup);
PyErr_Clear();
- pyret = PyEval_CallObject(pycb, list);
+ pyret = PyObject_Call(pycb, list, NULL);
if (PyErr_Occurred()) {
PyErr_Print();
goto cleanup;
@@ -5505,7 +5505,7 @@ libvirt_virEventAddHandleFunc(int fd,
VIR_PY_TUPLE_SET_GOTO(cb_args, 1, libvirt_virVoidPtrWrap(opaque), cleanup);
VIR_PY_TUPLE_SET_GOTO(cb_args, 2, libvirt_virFreeCallbackWrap(ff), cleanup);
- result = PyEval_CallObject(addHandleObj, pyobj_args);
+ result = PyObject_Call(addHandleObj, pyobj_args, NULL);
if (!result) {
PyErr_Print();
PyErr_Clear();
@@ -5538,7 +5538,7 @@ libvirt_virEventUpdateHandleFunc(int watch,
VIR_PY_TUPLE_SET_GOTO(pyobj_args, 0, libvirt_intWrap(watch), cleanup);
VIR_PY_TUPLE_SET_GOTO(pyobj_args, 1, libvirt_intWrap(event), cleanup);
- result = PyEval_CallObject(updateHandleObj, pyobj_args);
+ result = PyObject_Call(updateHandleObj, pyobj_args, NULL);
if (!result) {
PyErr_Print();
PyErr_Clear();
@@ -5566,7 +5566,7 @@ libvirt_virEventRemoveHandleFunc(int watch)
VIR_PY_TUPLE_SET_GOTO(pyobj_args, 0, libvirt_intWrap(watch), cleanup);
- result = PyEval_CallObject(removeHandleObj, pyobj_args);
+ result = PyObject_Call(removeHandleObj, pyobj_args, NULL);
if (result) {
retval = 0;
} else {
@@ -5623,7 +5623,7 @@ libvirt_virEventAddTimeoutFunc(int timeout,
VIR_PY_TUPLE_SET_GOTO(cb_args, 1, libvirt_virVoidPtrWrap(opaque), cleanup);
VIR_PY_TUPLE_SET_GOTO(cb_args, 2, libvirt_virFreeCallbackWrap(ff), cleanup);
- result = PyEval_CallObject(addTimeoutObj, pyobj_args);
+ result = PyObject_Call(addTimeoutObj, pyobj_args, NULL);
if (!result) {
PyErr_Print();
PyErr_Clear();
@@ -5654,7 +5654,7 @@ libvirt_virEventUpdateTimeoutFunc(int timer,
VIR_PY_TUPLE_SET_GOTO(pyobj_args, 0, libvirt_intWrap(timer), cleanup);
VIR_PY_TUPLE_SET_GOTO(pyobj_args, 1, libvirt_intWrap(timeout), cleanup);
- result = PyEval_CallObject(updateTimeoutObj, pyobj_args);
+ result = PyObject_Call(updateTimeoutObj, pyobj_args, NULL);
if (!result) {
PyErr_Print();
PyErr_Clear();
@@ -5681,7 +5681,7 @@ libvirt_virEventRemoveTimeoutFunc(int timer)
VIR_PY_TUPLE_SET_GOTO(pyobj_args, 0, libvirt_intWrap(timer), cleanup);
- result = PyEval_CallObject(removeTimeoutObj, pyobj_args);
+ result = PyObject_Call(removeTimeoutObj, pyobj_args, NULL);
if (result) {
retval = 0;
} else {
--
2.27.0

View File

@ -1,29 +0,0 @@
From b8dad684bbb693de70ebd9393f6f8fd1da310d85 Mon Sep 17 00:00:00 2001
From: Jonathon Jongsma <jjongsma@redhat.com>
Date: Tue, 21 Sep 2021 14:10:59 -0500
Subject: [PATCH 3/6] Update readme to mention pytest instead of nose
Commit a376a2ab switch from python-nose to python-pytest for tests, but
the README was not updated.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
README | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README b/README
index 96082f0..e42afa5 100644
--- a/README
+++ b/README
@@ -21,7 +21,7 @@ or to install as non-root
python setup.py build
python setup.py install --user
-If python-nose is installed, you can test the package with
+If python-pytest is installed, you can test the package with
python setup.py test
--
2.27.0

View File

@ -1,55 +0,0 @@
From cb8cceb0d8498bf0e2595a0830ab253afc3d64c7 Mon Sep 17 00:00:00 2001
From: Philipp Hahn <hahn@univention.de>
Date: Mon, 27 Apr 2020 14:57:04 +0200
Subject: [PATCH 001/297] examples/event-test: Use atexit for Python 3
Assigning sys.exitfunc no longer works with Python 3.
Use atexit.register() instead.
Signed-off-by: Philipp Hahn <hahn@univention.de>
---
examples/event-test.py | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/examples/event-test.py b/examples/event-test.py
index 0bebf23..7a73da5 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -6,6 +6,7 @@
# Start off by implementing a general purpose event loop for anyone's use
##############################################################################
+import atexit
import sys
import getopt
import os
@@ -15,6 +16,7 @@ import errno
import time
import threading
+
# This example can use three different event loop impls. It defaults
# to a portable pure-python impl based on poll that is implemented
# in this file.
@@ -776,16 +778,12 @@ def main():
vc = libvirt.openReadOnly(uri)
# Close connection on exit (to test cleanup paths)
- old_exitfunc = getattr(sys, 'exitfunc', None)
-
def exit():
print("Closing " + vc.getURI())
if run:
vc.close()
- if (old_exitfunc):
- old_exitfunc()
- sys.exitfunc = exit
+ atexit.register(exit)
vc.registerCloseCallback(myConnectionCloseCallback, None)
--
2.38.1.windows.1

Binary file not shown.

Binary file not shown.

View File

@ -2,23 +2,12 @@
Summary: The libvirt virtualization API python3 binding
Name: libvirt-python
Version: 6.2.0
Release: 8
Version: 9.10.0
Release: 1
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
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
Patch0007: Fix-the-invalid-operation-between-incompatible-types.patch
Patch0008: Fix-string-formatting.patch
Patch0009: Fix-BlockThreshold-Callback-argument-conversion-once.patch
Patch0010: examples-event-test-Use-atexit-for-Python-3.patch
Url: http://libvirt.org
License: LGPLv2+
BuildRequires: libvirt-devel == %{version}
BuildRequires: libvirt-devel
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-lxml
@ -68,7 +57,7 @@ find examples -type f -exec chmod 0644 \{\} \;
%files -n python3-libvirt
%defattr(-,root,root)
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
%doc README COPYING examples/
%{python3_sitearch}/libvirt.py*
%{python3_sitearch}/libvirtaio.py*
%{python3_sitearch}/libvirt_qemu.py*
@ -81,33 +70,5 @@ find examples -type f -exec chmod 0644 \{\} \;
%{python3_sitearch}/*egg-info
%changelog
* Mon Jul 17 2023 shechenglong <shechenglong@xfusion.com> - 6.2.0-8
- examples: examples/event-test: Use atexit for Python 3
* Thu May 11 2023 ChenYanpan <chenyanpan@xfusion.com> - 6.2.0-7
- add BuildRequires python3-libvirt to fix build failure
* Fri Apr 14 2023 Qi Hao <qihao_yewu@cmss.chinamobile.com> - 6.2.0-6
- libvirt-override.c: Fix BlockThreshold Callback argument conversion
* Tue Nov 29 2022 Qi Hao <qihao_yewu@cmss.chinamobile.com> - 6.2.0-5
- generator: Fix string formatting
* Fri Nov 25 2022 Qi Hao <qihao_yewu@cmss.chinamobile.com> - 6.2.0-4
- Fix the invalid "+" operation between incompatible types
* Tue Mar 29 2022 yezengruan <yezengruan@huawei.com> - 6.2.0-3
- Avoid truncating python version number when running sanity test
* Tue Jan 11 2022 imxcc <xingchaochao@huawei.com> - 6.2.0-2
- setup: use pytest instead of nose to run the test suite
- spec: use pytest instead of nose
- Update readme to mention pytest instead of nose
- Fix PY_SSIZE_T_CLEAN deprecation warning
- Avoid use of thread function deprecated in 3.9
- Replace deprecated PyEval_CallObject with PyObject_Call
* Wed Apr 15 2020 Xu Yandong <xuyandong2@huawei.com> - 6.2.0-1
- Rebase to version 6.2.0.
* Fri Jul 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 5.5.0-1
- Update to 5.5.0 release, Initial package for openEuler.
* Thu Feb 29 2024 mayunlong <mayunlong6@huawei.com> - 9.10.0-1
- Update to 9.10.0 release, Initial package for openEuler.

View File

@ -1,82 +0,0 @@
From 8f41e98220749e64164a5c9346e9875af3489a1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Tue, 6 Apr 2021 20:07:25 +0200
Subject: [PATCH 1/6] setup: use pytest instead of nose to run the test suite
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The software we use for running tests - nose - has been
deprecated in favor of nose2.
We don't use anything nose-specific, just unittest.TestCase,
which pytest can handle just fine.
Switch to using pytest, which we already use for libvirt-dbus.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
setup.py | 16 ++++++++--------
tox.ini | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/setup.py b/setup.py
index 56b6eea..ffb0e13 100755
--- a/setup.py
+++ b/setup.py
@@ -292,13 +292,13 @@ class my_test(Command):
self.build_platlib = os.path.join(self.build_base,
'lib' + plat_specifier)
- def find_nosetests_path(self):
+ def find_pytest_path(self):
binaries = [
- "nosetests-%d.%d" % (sys.version_info[0],
+ "pytest-%d.%d" % (sys.version_info[0],
sys.version_info[1]),
- "nosetests-%d" % (sys.version_info[0]),
- "nosetests%d" % (sys.version_info[0]),
- "nosetests",
+ "pytest-%d" % (sys.version_info[0]),
+ "pytest%d" % (sys.version_info[0]),
+ "pytest",
]
for binary in binaries:
@@ -306,7 +306,7 @@ class my_test(Command):
if path is not None:
return path
- raise Exception("Cannot find any nosetests binary")
+ raise Exception("Cannot find any pytest binary")
def run(self):
"""
@@ -320,8 +320,8 @@ class my_test(Command):
else:
os.environ["PYTHONPATH"] = self.build_platlib
self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
- nose = self.find_nosetests_path()
- self.spawn([sys.executable, nose])
+ pytest = self.find_pytest_path()
+ self.spawn([sys.executable, pytest])
class my_clean(clean):
diff --git a/tox.ini b/tox.ini
index de683b9..24c96c2 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,7 @@ envlist = py36,py37,py38
[testenv]
deps=
lxml
- nose
+ pytest
commands=
python sanitytest.py
- nosetests
+ pytest
--
2.27.0

View File

@ -1,33 +0,0 @@
From 2b91386845357615bdef36ea597bd1a25b12987e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Thu, 8 Apr 2021 16:20:46 +0200
Subject: [PATCH 2/6] spec: use pytest instead of nose
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
libvirt-python.spec | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt-python.spec b/libvirt-python.spec
index 676b696..5cb671f 100644
--- a/libvirt-python.spec
+++ b/libvirt-python.spec
@@ -22,10 +22,10 @@ License: LGPLv2+
BuildRequires: libvirt-devel == %{version}
BuildRequires: python3-devel
%if 0%{?rhel} == 7
-BuildRequires: python36-nose
+BuildRequires: python36-pytest
BuildRequires: python36-lxml
%else
-BuildRequires: python3-nose
+BuildRequires: python3-pytest
BuildRequires: python3-lxml
%endif
BuildRequires: gcc
--
2.27.0