1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2024-10-26 07:55:06 +03:00
Python language binding for libvirt native C API
Go to file
Daniel P. Berrangé c647a8ba2a gitlab: stop using a venv when creating source/binary dist
The change to use 'python -m build' in

  commit 333c8bef2b
  Author: Erik Skultety <eskultet@redhat.com>
  Date:   Tue Jun 20 12:19:40 2023 +0200

    ci: Drop direct 'setup.py' usage

resulted in the CI jobs all downloading latest setuptools and
deps from pypi and running builds with them in a venv. IOW we
ceased testing against the setuptools/wheel packages provided
by the distro, which is the whole point of the CI.

Passing the '-n -x' flags to 'python -m build' tells it to stop
using a venv and not to check dependancies, thus letting it
use what we pre-installed in the container.

This doesn't work on CentOS Stream 8, however, so we revert to
using the old setup.py approach. This is a short term issue,
since Stream 8 is EOL at the end of May, so we'll be deleting
all the Stream 8 jobs across libvirt CI very soon.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-04-30 10:23:31 +01:00
.github/workflows Switch to new GitHub repo-lockdown configuration 2021-12-01 09:27:50 +00:00
ci gitlab: stop using a venv when creating source/binary dist 2024-04-30 10:23:31 +01:00
examples Add binding for network metadata events 2023-09-21 11:58:47 +01:00
tests test_api_coverage: Reflect different naming in python for virDomainFDAssociate() and virDomainRestoreParams() 2024-02-27 15:08:17 +01:00
.ctags maint: Add ctags configuration file and ignore the output 2014-03-24 19:15:02 +01:00
.dir-locals.el maint: set up preferred emacs settings 2014-03-24 11:04:15 -06:00
.gitignore .gitignore: Ignore more common Python build artifacts 2023-01-06 10:19:13 +01:00
.gitlab-ci.yml gitlab: stop using a venv when creating source/binary dist 2024-04-30 10:23:31 +01:00
.mailmap Fix duplicate entries in AUTHORS 2015-05-28 14:50:51 -06:00
AUTHORS.in Setup distutils build system 2013-11-22 15:58:06 +00:00
CONTRIBUTING.rst gitlab: add CONTRIBUTING.rst file to indicate use of merge requests 2020-05-05 12:10:18 +01:00
COPYING COPYING: Only ship a single license file COPYING 2023-06-08 09:52:47 +02:00
generator.py add missing includes for C library functions 2023-09-25 11:17:31 +00:00
HACKING Add virDomainCheckpoint APIs 2019-07-29 13:39:39 -05:00
libvirt-lxc-override-api.xml Introduce an LXC specific public API & library 2013-01-14 13:58:34 +00:00
libvirt-lxc-override.c debug: Fix bit-rot in debug output 2020-07-27 13:24:36 +02:00
libvirt-override-api.xml Add an override impl for virDomainRestoreParams and virDomainSaveParams 2022-05-13 13:28:11 +02:00
libvirt-override-virConnect.py Add binding for network metadata events 2023-09-21 11:58:47 +01:00
libvirt-override-virDomain.py override: domain: Implement override for virDomainFDAssociate 2023-01-12 13:52:25 +01:00
libvirt-override-virDomainCheckpoint.py override: Convert to list comprehension 2020-08-18 09:48:25 +00:00
libvirt-override-virDomainSnapshot.py override: Convert to list comprehension 2020-08-18 09:48:25 +00:00
libvirt-override-virNetwork.py override: Convert to list comprehension 2020-08-18 09:48:25 +00:00
libvirt-override-virStoragePool.py override: Convert to list comprehension 2020-08-18 09:48:25 +00:00
libvirt-override-virStream.py stream: Convert type() to isinstance() 2020-08-18 09:48:25 +00:00
libvirt-override.c Fix memory leak in virStreamRecvFlags 2024-02-20 13:53:29 +01:00
libvirt-override.py generator: refactor buildWrappers to make it more generic 2022-04-21 12:32:51 +01:00
libvirt-python.spec.in spec: Invoke pytest properly 2023-06-22 10:52:40 +02:00
libvirt-qemu-override-api.xml qemu-api: Fix return type 2020-07-27 13:24:36 +02:00
libvirt-qemu-override.c add missing includes for C library functions 2023-09-25 11:17:31 +00:00
libvirt-qemu-override.py generator: merge python wrapper generator methods 2022-04-21 12:32:51 +01:00
libvirt-utils.c Use PySequence_GetItem preferentially 2023-09-25 11:17:31 +00:00
libvirt-utils.h Drop support for python 2 2019-12-04 12:14:51 +00:00
libvirtaio.py libvirtaio: add better docs on best practice usage pattern 2022-06-08 16:43:52 +01:00
Makefile Makefile: Add a 'test' rule to run the full tox execution 2023-06-22 10:27:41 +02:00
MANIFEST.in setup: Query library version out of a file 2023-06-22 10:27:41 +02:00
pyproject.toml Add pyproject.toml 2023-06-22 10:27:41 +02:00
README README: Drop direct 'setup.py' usage 2023-06-22 10:52:40 +02:00
requirements-test.txt Add travis build config 2017-09-19 16:11:23 +01:00
setup.cfg setup: Query library version out of a file 2023-06-22 10:27:41 +02:00
setup.py Request the Python stable API when building 2023-09-25 11:17:31 +00:00
tox.ini tox.ini: Drop sanitytest execution 2023-06-08 09:52:50 +02:00
typewrappers.c add missing includes for C library functions 2023-09-25 11:17:31 +00:00
typewrappers.h Replace uint with unsigned int 2022-09-09 17:18:56 +02:00
VERSION Post-release version bump to 10.3.0 2024-04-02 13:44:28 +02:00

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.