Skip to content

libvirt/libvirt-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Jiri Denemark
Apr 1, 2025
e8e353f · Apr 1, 2025
Dec 1, 2021
Feb 17, 2025
Mar 25, 2025
May 2, 2024
Mar 24, 2014
Mar 24, 2014
Jan 6, 2023
May 2, 2024
May 28, 2015
Nov 22, 2013
May 5, 2020
Jun 8, 2023
Jul 29, 2019
Jun 22, 2023
Aug 8, 2024
Jun 22, 2023
Apr 1, 2025
Mar 21, 2025
Jan 14, 2013
May 2, 2024
Mar 21, 2025
Mar 25, 2025
Jan 12, 2023
Aug 18, 2020
Aug 18, 2020
Aug 18, 2020
Aug 18, 2020
Aug 18, 2020
Mar 25, 2025
Mar 26, 2025
May 2, 2024
Jul 27, 2020
May 2, 2024
Apr 21, 2022
Sep 25, 2023
Dec 4, 2019
Jun 8, 2022
Jun 22, 2023
Sep 19, 2017
Jun 22, 2023
May 2, 2024
Oct 22, 2024
Sep 25, 2023
Sep 9, 2022

Repository files navigation

Libvirt Python Binding README
=============================

This package provides a module that permits applications
written in the Python 3.x programming language to call the interface
supplied by the libvirt library, to manage the virtualization
capabilities of recent versions of Linux (and other OSes).
As such, the module exposes Python bindings to to the libvirt.so,
libvirt-qemu.so and libvirt-lxc.so library APIs.

It is written to build against any version of libvirt that
is 0.9.11 or newer.

This code is distributed under the terms of the LGPL version
2 or later.

Requirements
------------

To build the libvirt python binary requires the GCC and pkg-config
tools, and development headers for the libvirt and python libraries.

Building and installing
-----------------------

The module can be built by following the normal python module
build process

  $ python3 -m build

for testing and distributing purposes or it can be installed directly via pip
as

  $ python3 -m pip install .

without explicit building.

In order to test the package, you'll need either tox or at least pytest,
depending on whether you want to test an already installed package in which
case the latter is sufficient or if you wish to test in a virtual
environment you'd need tox. Depending on your preferred setup, you can run the
tests either as

  $ python3 -m pytest

or as

  $ tox

A makefile shim is also provided for your convenience, so that you don't have
to care about the exact operations mentioned above and instead you simply do

  $ make && make check

As of libvirt 1.2.6, it is possible to develop against an uninstalled
libvirt.git checkout, by setting PKG_CONFIG_PATH and LD_LIBRARY_PATH
environment variables to point into that libvirt tree; you can even
automate this by using libvirt's run script:

  /path/to/libvirt/run python3 -m build

Patches for this code should be submitted as merge requests to the
project page on gitlab. See CONTRIBUTING.rst for more information.