libvirt-python 10.3.0__tar.gz → 10.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/ChangeLog +86 -0
  2. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/PKG-INFO +1 -1
  3. libvirt-python-10.4.0/VERSION +1 -0
  4. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/generator.py +25 -15
  5. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-lxc-override.c +3 -9
  6. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override.c +3 -9
  7. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-python.spec +1 -1
  8. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-qemu-override.c +3 -9
  9. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/setup.py +2 -1
  10. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_aio.py +2 -2
  11. libvirt-python-10.3.0/VERSION +0 -1
  12. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/AUTHORS +0 -0
  13. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/CONTRIBUTING.rst +0 -0
  14. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/COPYING +0 -0
  15. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/HACKING +0 -0
  16. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/MANIFEST.in +0 -0
  17. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/Makefile +0 -0
  18. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/README +0 -0
  19. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/build/libvirt_python.egg-info/SOURCES.txt +0 -0
  20. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/README +0 -0
  21. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/consolecallback.py +0 -0
  22. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/dhcpleases.py +0 -0
  23. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/dominfo.py +0 -0
  24. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/domipaddrs.py +0 -0
  25. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/domrestore.py +0 -0
  26. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/domsave.py +0 -0
  27. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/domstart.py +0 -0
  28. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/esxlist.py +0 -0
  29. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/event-test.py +0 -0
  30. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/guest-vcpus/guest-vcpu-daemon.py +0 -0
  31. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/guest-vcpus/guest-vcpu.py +0 -0
  32. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/nodestats.py +0 -0
  33. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/sparsestream.py +0 -0
  34. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/examples/topology.py +0 -0
  35. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-lxc-override-api.xml +0 -0
  36. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override-api.xml +0 -0
  37. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override-virConnect.py +0 -0
  38. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override-virDomain.py +0 -0
  39. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override-virDomainCheckpoint.py +0 -0
  40. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override-virDomainSnapshot.py +0 -0
  41. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override-virNetwork.py +0 -0
  42. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override-virStoragePool.py +0 -0
  43. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override-virStream.py +0 -0
  44. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-override.py +0 -0
  45. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-qemu-override-api.xml +0 -0
  46. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-qemu-override.py +0 -0
  47. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-utils.c +0 -0
  48. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirt-utils.h +0 -0
  49. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/libvirtaio.py +0 -0
  50. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/pyproject.toml +0 -0
  51. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/requirements-test.txt +0 -0
  52. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/setup.cfg +0 -0
  53. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/eventmock.py +0 -0
  54. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_api_coverage.py +0 -0
  55. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_conn.py +0 -0
  56. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_domain.py +0 -0
  57. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_domain_checkpoint.py +0 -0
  58. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_domain_snapshot.py +0 -0
  59. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_interface.py +0 -0
  60. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_network.py +0 -0
  61. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_nodedev.py +0 -0
  62. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tests/test_storage.py +0 -0
  63. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/tox.ini +0 -0
  64. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/typewrappers.c +0 -0
  65. {libvirt-python-10.3.0 → libvirt-python-10.4.0}/typewrappers.h +0 -0
@@ -1,3 +1,89 @@
1
+ 2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
2
+
3
+ ci: Drop CentOS 8 Stream and switch F38 to 40, Ubuntu 20.04 to 22.04
4
+ There a lot happening here, but that's because otherwise lcitool
5
+ fails to regenerate files. Firstly, CentOS 8 is dropped as it's
6
+ unsupported now. Secondly, Fedora 40 is introduced and Fedora 38
7
+ is dropped. And lastly, Ubuntu 24.04 is introduced and Ubuntu
8
+ 20.04 is dropped.
9
+
10
+
11
+
12
+ 2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
13
+
14
+ test_aio.py: Fix skip message
15
+ There are two unit tests in test_aio.py that are skipped if
16
+ Python is too new (3.10 or newer). But the message printed when
17
+ they are skipped mentions just 3.10 which is confusing. Change it
18
+ to "3.10+".
19
+
20
+
21
+
22
+ 2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
23
+
24
+ Switch to PyMODINIT_FUNC annotation
25
+ Instead of doing some 'extern ...' declaration magic to force
26
+ proper PyInit_libvirtmod*() symbol exposure in resulting .so we
27
+ can use what Python already offers - PyMODINIT_FUNC macro and
28
+ call it a day.
29
+
30
+
31
+
32
+ 2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
33
+
34
+ generator.py: Drop build/ prefix from #include
35
+ When -Ibuild flag is passed to compiler then build/ can be dropped
36
+ from includes. This is safe to do, because the prefix is only on
37
+ local includes (#include "") not system ones (#include <>).
38
+
39
+
40
+
41
+ 2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
42
+
43
+ generator.py: Switch from ${module}-export.c to ${module}-export.c.inc
44
+ The generator.py generates a (per module) table of functions it
45
+ generated code for and stores it in ${module}-export.c file. The
46
+ file is then #include-d in corresponding override.c in the table
47
+ of all methods implemented in the module.
48
+
49
+ Now, problem is with naming of the file because the ".c" suffix
50
+ might suggest the file needs to be compiled. Well, it doesn't.
51
+ It's way closer to being a header file, so change the suffix to
52
+ ".c.inc".
53
+
54
+
55
+
56
+ 2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
57
+
58
+ generator.py: Allow source and build dirs override
59
+ Soon generator.py is going to be ran from a build directory which
60
+ is different than the source directory. Allow specifying these
61
+ directories on the cmd line.
62
+
63
+ And while at it, introduce new "c+py" output mode in which both C
64
+ and Python files are generated. While this is a fallback mode if
65
+ no output mode is selected, we need this new mode so that
66
+ aforementioned directories can be specified.
67
+
68
+
69
+
70
+ 2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
71
+
72
+ setup.py: s/PY_VERSION/VERSION/
73
+ When generating spec file, @PY_VERSION@ is replaced with the
74
+ current version of libvirt-python. Well, it's not as obvious as
75
+ it could be: usually it's just @VERSION@. Worse, the PY_ prefix
76
+ may mislead readers into thinking it refers to python version.
77
+
78
+ Just drop the PY_ prefix.
79
+
80
+
81
+
82
+ 2024- 5- 2 Jiri Denemark <jdenemar@redhat.com>
83
+
84
+ Post-release version bump to 10.4.0
85
+
86
+
1
87
  2024- 5- 1 Jelle van der Waa <jvanderwaa@redhat.com>
2
88
 
3
89
  examples: replace logging.warn with logging.warning
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libvirt-python
3
- Version: 10.3.0
3
+ Version: 10.4.0
4
4
  Summary: The libvirt virtualization API python binding
5
5
  Home-page: http://www.libvirt.org
6
6
  Maintainer: Libvirt Maintainers
@@ -0,0 +1 @@
1
+ 10.4.0
@@ -31,6 +31,8 @@ quiet = True
31
31
  #######################################################################
32
32
  debug = 0
33
33
  onlyOverrides = False
34
+ sourceDir = "."
35
+ buildDir = "build"
34
36
 
35
37
  libvirt_headers = [
36
38
  "libvirt",
@@ -49,6 +51,11 @@ libvirt_headers = [
49
51
  "libvirt-stream",
50
52
  ]
51
53
 
54
+ def openSourceFile(file: str, mode: str = "r", optional: bool = False):
55
+ path = os.path.join(sourceDir, file)
56
+ if optional and not os.path.exists(path):
57
+ return None
58
+ return open(path, mode)
52
59
 
53
60
  def parse(data: IO[str]) -> None:
54
61
  target = docParser()
@@ -297,7 +304,7 @@ py_types = {
297
304
  #######################################################################
298
305
  #
299
306
  # This part writes the C <-> Python stubs libvirt.[ch] and
300
- # the table libvirt-export.c to add when registering the Python module
307
+ # the table libvirt-export.c.inc to add when registering the Python module
301
308
  #
302
309
  #######################################################################
303
310
 
@@ -853,7 +860,7 @@ def load_apis(module: str, api_xml: str):
853
860
 
854
861
  try:
855
862
  onlyOverrides = True
856
- with open(override_api_xml) as stream:
863
+ with openSourceFile(override_api_xml) as stream:
857
864
  parse(stream)
858
865
  except IOError as msg:
859
866
  print(override_api_xml, ":", msg)
@@ -869,9 +876,9 @@ def emit_c_code(module: str) -> None:
869
876
 
870
877
  nb_wrap = 0
871
878
 
872
- header_file = "build/%s.h" % module
873
- export_file = "build/%s-export.c" % module
874
- wrapper_file = "build/%s.c" % module
879
+ header_file = "%s/%s.h" % (buildDir, module)
880
+ export_file = "%s/%s-export.c.inc" % (buildDir, module)
881
+ wrapper_file = "%s/%s.c" % (buildDir, module)
875
882
 
876
883
  include = open(header_file, "w")
877
884
  include.write("/* Generated by generator.py */\n\n")
@@ -885,7 +892,7 @@ def emit_c_code(module: str) -> None:
885
892
  wrapper.write("#include <Python.h>\n")
886
893
  wrapper.write("#include <libvirt/%s.h>\n" % (module,))
887
894
  wrapper.write("#include \"typewrappers.h\"\n")
888
- wrapper.write("#include \"build/%s.h\"\n\n" % (module,))
895
+ wrapper.write("#include \"%s.h\"\n\n" % (module))
889
896
 
890
897
  for function in sorted(functions):
891
898
  if print_function_wrapper(package, function, wrapper, export, include):
@@ -1313,14 +1320,12 @@ def emit_py_code(module: str) -> None:
1313
1320
  info = (0, func, name, ret, args, file, mod)
1314
1321
  function_classes['None'].append(info)
1315
1322
 
1316
- classes_file = "build/%s.py" % package
1323
+ classes_file = "%s/%s.py" % (buildDir, package)
1317
1324
  extra_file = "%s-override.py" % module
1318
- extra = None
1325
+ extra = openSourceFile(extra_file, "r", True)
1319
1326
 
1320
1327
  classes = open(classes_file, "w")
1321
1328
 
1322
- if os.path.exists(extra_file):
1323
- extra = open(extra_file, "r")
1324
1329
  classes.write("#\n")
1325
1330
  classes.write("# WARNING WARNING WARNING WARNING\n")
1326
1331
  classes.write("#\n")
@@ -1629,8 +1634,8 @@ def emit_py_code(module: str) -> None:
1629
1634
  classes.write("\n")
1630
1635
  # Append "<classname>.py" to class def, iff it exists
1631
1636
  class_override = "%s-override-%s.py" % (module, classname)
1632
- if os.path.exists(class_override):
1633
- extra = open(class_override, "r")
1637
+ extra = openSourceFile(class_override, "r", True)
1638
+ if extra:
1634
1639
  classes.write(" #\n")
1635
1640
  classes.write(" # %s methods from %s.py (hand coded)\n" % (classname, classname))
1636
1641
  classes.write(" #\n")
@@ -1776,6 +1781,11 @@ if sys.argv[1] not in ["libvirt", "libvirt-lxc", "libvirt-qemu"]:
1776
1781
  print("ERROR: unknown module %s" % sys.argv[1])
1777
1782
  sys.exit(1)
1778
1783
 
1784
+ if len(sys.argv) == 6:
1785
+ buildDir = sys.argv[5]
1786
+ if len(sys.argv) >= 5:
1787
+ sourceDir = sys.argv[4]
1788
+
1779
1789
  load_apis(sys.argv[1], sys.argv[2])
1780
1790
 
1781
1791
  if validate_functions() < 0:
@@ -1786,12 +1796,12 @@ if not os.path.exists("build"):
1786
1796
  os.mkdir("build")
1787
1797
 
1788
1798
  output = None
1789
- if len(sys.argv) == 4:
1799
+ if len(sys.argv) >= 4:
1790
1800
  output = sys.argv[3]
1791
- if output == "c" or output is None:
1801
+ if output == "c" or output == "c+py" or output is None:
1792
1802
  emit_c_code(sys.argv[1])
1793
1803
 
1794
- if output == "py" or output is None:
1804
+ if output == "py" or output == "c+py" or output is None:
1795
1805
  emit_py_code(sys.argv[1])
1796
1806
 
1797
1807
  sys.exit(0)
@@ -19,13 +19,7 @@
19
19
  #include <libvirt/virterror.h>
20
20
  #include "typewrappers.h"
21
21
  #include "libvirt-utils.h"
22
- #include "build/libvirt-lxc.h"
23
-
24
- #ifndef __CYGWIN__
25
- extern PyObject *PyInit_libvirtmod_lxc(void);
26
- #else
27
- extern PyObject *PyInit_cygvirtmod_lxc(void);
28
- #endif
22
+ #include "libvirt-lxc.h"
29
23
 
30
24
  #if 0
31
25
  # define DEBUG_ERROR 1
@@ -94,7 +88,7 @@ libvirt_lxc_virDomainLxcOpenNamespace(PyObject *self ATTRIBUTE_UNUSED,
94
88
  * *
95
89
  ************************************************************************/
96
90
  static PyMethodDef libvirtLxcMethods[] = {
97
- #include "build/libvirt-lxc-export.c"
91
+ #include "libvirt-lxc-export.c.inc"
98
92
  {(char *) "virDomainLxcOpenNamespace", libvirt_lxc_virDomainLxcOpenNamespace, METH_VARARGS, NULL},
99
93
  {NULL, NULL, 0, NULL}
100
94
  };
@@ -115,7 +109,7 @@ static struct PyModuleDef moduledef = {
115
109
  NULL
116
110
  };
117
111
 
118
- PyObject *
112
+ PyMODINIT_FUNC
119
113
  #ifndef __CYGWIN__
120
114
  PyInit_libvirtmod_lxc
121
115
  #else
@@ -26,15 +26,9 @@
26
26
  #include <libvirt/virterror.h>
27
27
  #include <stddef.h>
28
28
  #include "typewrappers.h"
29
- #include "build/libvirt.h"
29
+ #include "libvirt.h"
30
30
  #include "libvirt-utils.h"
31
31
 
32
- #ifndef __CYGWIN__
33
- extern PyObject *PyInit_libvirtmod(void);
34
- #else
35
- extern PyObject *PyInit_cygvirtmod(void);
36
- #endif
37
-
38
32
  #if 0
39
33
  # define DEBUG_ERROR 1
40
34
  #endif
@@ -10930,7 +10924,7 @@ libvirt_virDomainFDAssociate(PyObject *self ATTRIBUTE_UNUSED,
10930
10924
  * *
10931
10925
  ************************************************************************/
10932
10926
  static PyMethodDef libvirtMethods[] = {
10933
- #include "build/libvirt-export.c"
10927
+ #include "libvirt-export.c.inc"
10934
10928
  {(char *) "virGetVersion", libvirt_virGetVersion, METH_VARARGS, NULL},
10935
10929
  {(char *) "virConnectGetVersion", libvirt_virConnectGetVersion, METH_VARARGS, NULL},
10936
10930
  #if LIBVIR_CHECK_VERSION(1, 1, 3)
@@ -11227,7 +11221,7 @@ static struct PyModuleDef moduledef = {
11227
11221
  NULL
11228
11222
  };
11229
11223
 
11230
- PyObject *
11224
+ PyMODINIT_FUNC
11231
11225
  #ifndef __CYGWIN__
11232
11226
  PyInit_libvirtmod
11233
11227
  #else
@@ -14,7 +14,7 @@
14
14
 
15
15
  Summary: The libvirt virtualization API python3 binding
16
16
  Name: libvirt-python
17
- Version: 10.3.0
17
+ Version: 10.4.0
18
18
  Release: 1%{?dist}
19
19
  Source0: https://libvirt.org/sources/python/%{name}-%{version}.tar.gz
20
20
  Url: https://libvirt.org
@@ -20,17 +20,11 @@
20
20
  #include <libvirt/virterror.h>
21
21
  #include "typewrappers.h"
22
22
  #include "libvirt-utils.h"
23
- #include "build/libvirt-qemu.h"
23
+ #include "libvirt-qemu.h"
24
24
  #ifndef __CYGWIN__
25
25
  # include <fcntl.h>
26
26
  #endif
27
27
 
28
- #ifndef __CYGWIN__
29
- extern PyObject *PyInit_libvirtmod_qemu(void);
30
- #else
31
- extern PyObject *PyInit_cygvirtmod_qemu(void);
32
- #endif
33
-
34
28
  #if 0
35
29
  # define DEBUG_ERROR 1
36
30
  #endif
@@ -447,7 +441,7 @@ libvirt_qemu_virDomainQemuMonitorCommandWithFiles(PyObject *self ATTRIBUTE_UNUSE
447
441
  * *
448
442
  ************************************************************************/
449
443
  static PyMethodDef libvirtQemuMethods[] = {
450
- #include "build/libvirt-qemu-export.c"
444
+ #include "libvirt-qemu-export.c.inc"
451
445
  {(char *) "virDomainQemuMonitorCommand", libvirt_qemu_virDomainQemuMonitorCommand, METH_VARARGS, NULL},
452
446
  #if LIBVIR_CHECK_VERSION(0, 10, 0)
453
447
  {(char *) "virDomainQemuAgentCommand", libvirt_qemu_virDomainQemuAgentCommand, METH_VARARGS, NULL},
@@ -478,7 +472,7 @@ static struct PyModuleDef moduledef = {
478
472
  NULL
479
473
  };
480
474
 
481
- PyObject *
475
+ PyMODINIT_FUNC
482
476
  #ifndef __CYGWIN__
483
477
  PyInit_libvirtmod_qemu
484
478
  #else
@@ -87,6 +87,7 @@ def get_module_lists():
87
87
  ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False).split()
88
88
  cflags = get_pkgconfig_data(["--cflags"], "libvirt", False).split()
89
89
 
90
+ cflags += ["-Ibuild"]
90
91
  cflags += ["-Wp,-DPy_LIMITED_API=0x03060000"]
91
92
 
92
93
  module = Extension("libvirtmod",
@@ -196,7 +197,7 @@ class my_sdist(sdist):
196
197
  def gen_rpm_spec(self):
197
198
  return self._gen_from_in("libvirt-python.spec.in",
198
199
  "libvirt-python.spec",
199
- "@PY_VERSION@",
200
+ "@VERSION@",
200
201
  getVersion())
201
202
 
202
203
  def gen_authors(self):
@@ -118,7 +118,7 @@ class TestLibvirtAio(unittest.TestCase):
118
118
 
119
119
  @mock.patch('libvirt.virEventRegisterImpl',
120
120
  side_effect=eventmock.virEventRegisterImplMock)
121
- @unittest.skipIf(sys.version_info >= (3,10), "test incompatible with 3.10")
121
+ @unittest.skipIf(sys.version_info >= (3,10), "test incompatible with 3.10+")
122
122
  def testEventsPreInitImplicit(self, mock_event_register):
123
123
  # Register libvirt events before starting the asyncio loop.
124
124
  #
@@ -136,7 +136,7 @@ class TestLibvirtAio(unittest.TestCase):
136
136
 
137
137
  @mock.patch('libvirt.virEventRegisterImpl',
138
138
  side_effect=eventmock.virEventRegisterImplMock)
139
- @unittest.skipIf(sys.version_info >= (3,10), "test incompatible with 3.10")
139
+ @unittest.skipIf(sys.version_info >= (3,10), "test incompatible with 3.10+")
140
140
  def testEventsImplicitLoopInit(self, mock_event_register):
141
141
  # Register libvirt events before starting the asyncio loop.
142
142
  #
@@ -1 +0,0 @@
1
- 10.3.0
File without changes
File without changes
File without changes
File without changes
File without changes