Commits on Source (34)
......@@ -25,10 +25,9 @@ stages:
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR"
- ninja -C build install
- popd
- $PYTHON setup.py build
- $PYTHON -m pip ${PIP_INSTALL:-install} .
- $PYTHON setup.py test
- $PYTHON setup.py sdist
- $PYTHON -m build
- $PYTHON -m pip ${PIP_INSTALL:-install} dist/libvirt_python*.whl
- $PYTHON -m pytest tests
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ;
then
rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt-python*tar.gz ;
......@@ -49,10 +48,9 @@ stages:
script:
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- export CFLAGS="-Werror"
- $PYTHON setup.py build
- $PYTHON -m pip ${PIP_INSTALL:-install} .
- $PYTHON setup.py test
- $PYTHON setup.py sdist
- $PYTHON -m build
- $PYTHON -m pip ${PIP_INSTALL:-install} dist/libvirt_python*.whl
- $PYTHON -m pytest tests
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ;
then
rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt-python*tar.gz ;
......@@ -75,7 +73,8 @@ include: '/ci/gitlab.yml'
stage: sanity_checks
script:
- *git_build_vars
- LIBVIRT_API_COVERAGE=1 $PYTHON setup.py test
- $PYTHON -m pip ${PIP_INSTALL:-install} dist/libvirt_python*.whl
- LIBVIRT_API_COVERAGE=1 $PYTHON -m pytest tests
allow_failure: true
api_coverage_prebuilt_env:
......
This diff is collapsed.
This diff is collapsed.
graft tests
graft examples
include AUTHORS
include COPYING
include COPYING.LESSER
include CONTRIBUTING.rst
include HACKING
include ChangeLog
include examples/README
include examples/consolecallback.py
include examples/dhcpleases.py
include examples/domipaddrs.py
include examples/dominfo.py
include examples/domrestore.py
include examples/domsave.py
include examples/domstart.py
include examples/esxlist.py
include examples/event-test.py
include examples/guest-vcpus/guest-vcpu-daemon.py
include examples/guest-vcpus/guest-vcpu.py
include examples/nodestats.py
include examples/sparsestream.py
include examples/topology.py
include generator.py
include libvirt-lxc-override-api.xml
include libvirt-lxc-override.c
include libvirt-override-api.xml
include libvirt-override.c
include libvirt-override.py
include libvirt-override-virConnect.py
include libvirt-override-virDomain.py
include libvirt-override-virDomainCheckpoint.py
include libvirt-override-virDomainSnapshot.py
include libvirt-override-virNetwork.py
include libvirt-override-virStoragePool.py
include libvirt-override-virStream.py
include libvirt-python.spec
include libvirt-qemu-override-api.xml
include libvirt-qemu-override.c
include libvirt-qemu-override.py
include libvirt-utils.h
include libvirt-utils.c
include libvirtaio.py
include MANIFEST
include MANIFEST.in
include README
include VERSION
include requirements-test.txt
include sanitytest.py
include setup.py
include tests/test_conn.py
include tests/test_domain.py
include tests/test_domain_checkpoint.py
include tests/test_domain_snapshot.py
include tests/test_interface.py
include tests/test_network.py
include tests/test_nodedev.py
include tests/test_storage.py
include tox.ini
include typewrappers.c
include typewrappers.h
include Makefile
include ChangeLog
include libvirt-python.spec
include *.[ch]
include *.xml
include *.py
global-exclude */__pycache__/*
global-exclude *.py[cod]
......@@ -3,16 +3,19 @@
PYTHON ?= python
all:
$(PYTHON) setup.py build
$(PYTHON) -m build
install: all
$(PYTHON) setup.py install
$(PYTHON) -m pip install .
clean:
$(PYTHON) setup.py clean
rm -rf build/ dist/
check: all
$(PYTHON) setup.py test
tox -e py36
rpm:
$(PYTHON) setup.py rpm
test: all
tox
rpm: all
rpmbuild -ta dist/libvirt-python-$(shell tr -d '\n' < VERSION).tar.gz
Libvirt Python Binding README
=============================
This package provides a python binding to the libvirt.so,
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
......@@ -22,30 +26,38 @@ Building and installing
The module can be built by following the normal python module
build process
python setup.py build
sudo python setup.py install
$ python3 -m build
or to install as non-root
for testing and distributing purposes or it can be installed directly via pip
as
python setup.py build
python setup.py install --user
$ python3 -m pip install .
If python-pytest is installed, you can test the package with
without explicit building.
python setup.py test
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
A makefile shim is provided so that you can do
$ python3 -m pytest
make && make check
or as
rather than directly invoking setup.py.
$ 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 python setup.py build
/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.
......@@ -40,12 +40,14 @@ function install_buildenv() {
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
rpcgen \
rpm-build
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
/usr/bin/pip3 install build
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
......
......@@ -24,11 +24,13 @@ function install_buildenv() {
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
rpm-build
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
/usr/bin/pip3 install build
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
......
......@@ -21,13 +21,16 @@ function install_buildenv() {
python3-lxml \
python3-pip \
python3-pytest \
python3-setuptools
python3-setuptools \
python3-venv \
python3-wheel
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
/usr/bin/pip3 install build
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
......
......@@ -17,11 +17,13 @@ function install_buildenv() {
locales \
pkgconf \
python3 \
python3-build \
python3-dev \
python3-lxml \
python3-pip \
python3-pytest \
python3-setuptools
python3-setuptools \
python3-venv
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
......
......@@ -15,6 +15,7 @@ function install_buildenv() {
libvirt-devel \
pkgconfig \
python3 \
python3-build \
python3-devel \
python3-lxml \
python3-pip \
......
......@@ -15,6 +15,7 @@ function install_buildenv() {
libvirt-devel \
pkgconfig \
python3 \
python3-build \
python3-devel \
python3-lxml \
python3-pip \
......
......@@ -16,6 +16,7 @@ function install_buildenv() {
libvirt-devel \
pkgconfig \
python3 \
python3-build \
python3-devel \
python3-lxml \
python3-pip \
......
......@@ -20,11 +20,13 @@ function install_buildenv() {
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
rpm-build
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
/usr/bin/pip3 install build
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
......
......@@ -20,11 +20,13 @@ function install_buildenv() {
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
rpm-build
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
/usr/bin/pip3 install build
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
......
......@@ -21,13 +21,16 @@ function install_buildenv() {
python3-lxml \
python3-pip \
python3-pytest \
python3-setuptools
python3-setuptools \
python3-venv \
python3-wheel
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
/usr/bin/pip3 install build
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
......
......@@ -21,13 +21,16 @@ function install_buildenv() {
python3-lxml \
python3-pip \
python3-pytest \
python3-setuptools
python3-setuptools \
python3-venv \
python3-wheel
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
/usr/bin/pip3 install build
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
......
......@@ -41,6 +41,7 @@ RUN dnf distro-sync -y && \
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
rpcgen \
rpm-build && \
dnf autoremove -y && \
......@@ -50,6 +51,8 @@ RUN dnf distro-sync -y && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
RUN /usr/bin/pip3 install build
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
......
......@@ -25,6 +25,7 @@ RUN dnf distro-sync -y && \
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
rpm-build && \
dnf autoremove -y && \
dnf clean all -y && \
......@@ -33,6 +34,8 @@ RUN dnf distro-sync -y && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
RUN /usr/bin/pip3 install build
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV PYTHON "/usr/bin/python3"