Debian Codegraph @

README

raw
1 Libvirt Python Binding README
2 =============================
3
4 This package provides a module that permits applications
5 written in the Python 3.x programming language to call the interface
6 supplied by the libvirt library, to manage the virtualization
7 capabilities of recent versions of Linux (and other OSes).
8 As such, the module exposes Python bindings to to the libvirt.so,
9 libvirt-qemu.so and libvirt-lxc.so library APIs.
10
11 It is written to build against any version of libvirt that
12 is 0.9.11 or newer.
13
14 This code is distributed under the terms of the LGPL version
15 2 or later.
16
17 Requirements
18 ------------
19
20 To build the libvirt python binary requires the GCC and pkg-config
21 tools, and development headers for the libvirt and python libraries.
22
23 Additionally, the Python build module is required and can be installed via:
24
25 $ dnf install python3-build
26
27 or
28
29 $ python3 -m pip install --user build
30
31 Building and installing
32 -----------------------
33
34 The module can be built by following the normal python module
35 build process
36
37 $ python3 -m build
38
39 for testing and distributing purposes or it can be installed directly via pip
40 as
41
42 $ python3 -m pip install .
43
44 without explicit building.
45
46 In order to test the package, you'll need either tox or at least pytest,
47 depending on whether you want to test an already installed package in which
48 case the latter is sufficient or if you wish to test in a virtual
49 environment you'd need tox.
50
51 To install pytest, use one of:
52
53 $ dnf install python3-pytest
54
55 or
56
57 $ python3 -m pip install --user pytest
58
59 To install tox, use one of:
60
61 $ dnf install python3-tox
62
63 or
64
65 $ python3 -m pip install --user tox
66
67 Additionally, install the remaining test dependencies:
68
69 $ python3 -m pip install -r requirements-test.txt
70
71 Depending on your preferred setup, you can run the tests either as
72
73 $ python3 -m pytest
74
75 or as
76
77 $ tox
78
79 Free-threaded Python (py313t, py314t) test environments require tox>=4.26
80 and the corresponding free-threaded interpreters (python3.13t, python3.14t)
81 to be installed.
82
83 A makefile shim is also provided for your convenience, so that you don't have
84 to care about the exact operations mentioned above and instead you simply do
85
86 $ make && make check
87
88 As of libvirt 1.2.6, it is possible to develop against an uninstalled
89 libvirt.git checkout, by setting PKG_CONFIG_PATH and LD_LIBRARY_PATH
90 environment variables to point into that libvirt tree; you can even
91 automate this by using libvirt's run script:
92
93 /path/to/libvirt/run python3 -m build
94
95 Patches for this code should be submitted as merge requests to the
96 project page on gitlab. See CONTRIBUTING.rst for more information.