1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-11 20:24:04 +03:00

152 Commits

Author SHA1 Message Date
Jiri Denemark
deabf3d88c Post-release version bump to 9.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-12-01 11:00:04 +01:00
Jiri Denemark
42305fb615 Post-release version bump to 8.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-11-01 12:37:38 +01:00
Jiri Denemark
bf95d64c72 Post-release version bump to 8.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-10-03 08:56:38 +00:00
Bastian Germann
c2374d3f4e Link libvirtmod_* modules also with libvirt
The -lvirt linker flag has to be added to the libvirtmod_qemu and
libvirtmod_lxc modules as well.

Signed-off-by: Bastian Germann <bage@linutronix.de>
2022-09-09 17:28:51 +02:00
Jiri Denemark
292da8384c Post-release version bump to 8.8.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-09-01 12:01:10 +02:00
Jiri Denemark
62681e1569 Post-release version bump to 8.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-08-01 09:40:54 +02:00
Jiri Denemark
2c8e159373 Post-release version bump to 8.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-01 11:27:50 +02:00
Pino Toscano
ba4db43f63 setup: make 'clean' command compatible again with distutils
After the switch of 'my_clean' to a simple Command, the 'clean' command
has no more bits for options, resulting in distutils (either external
or embedded in setuptools) complaining about it:

  distutils.errors.DistutilsClassError: command class <class '__main__.my_clean'> must provide 'user_options' attribute (a list of tuples)

To overcome that, provide all the standard bits from options, i.e. the
'user_options' list, and the 'initialize_options' & 'finalize_options'
methods. In addition, add a dummy 'all' option, as distutils wants it:

  error: error in [...]/.pydistutils.cfg: command 'my_clean' has no such option 'all'

Fixes commit a965c91c6f

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2022-06-25 06:38:30 +02:00
Daniel P. Berrangé
b34fbaf405 setup: advertize Python 3.9 and 3.10 support
Add classifiers that indicate we intend to support python versions
3.9 and 3.10.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-08 16:43:52 +01:00
Daniel P. Berrangé
e3fab09382 tests: use mocks to allow calling virEventRegisterImpl many times
We currently have to run each of the test_aio.py test cases in a
separate process, because libvirt.virEventRegisterImpl can only be
called once per process. This leads to quite unpleasant console
output when running tests.

By introducing a mock for libvirt.virEventRegisterImpl we can
regain the ability to run everything in a single process. The only
caveat is that it relies on tests to fully cleanup, but in practice
this is ok for our current tests.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-08 16:43:52 +01:00
Chris Gunn
b9f79758c9 tests: add libvirtaio test coverage
Signed-off-by: Chris Gunn <chrisgun@microsoft.com>
2022-06-08 16:43:52 +01:00
Jiri Denemark
8a0e3f052b Post-release version bump to 8.5.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-06-01 09:31:33 +02:00
Jiri Denemark
f27567e993 Post-release version bump to 8.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-05-02 13:38:10 +02:00
Daniel P. Berrangé
60044515a2 setup: switch to running API coverage test using pytest
The API coverage test is no longer a special case.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 15:00:29 +00:00
Daniel P. Berrangé
d4dfac2a43 sanitytest: stop passing python module path into sanity test
We want to move over to make sanitytest.py operate like a more normal
test script, which means making it self contained.

The setup.py already sets the PYTHONPATH thanks to changes introduced
in:

  commit eaded7bdad
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Tue Mar 18 11:11:48 2014 +0000

    Add support for running unit tests with nose

so passing the python module path into sanitytest.py is redundant.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 15:00:29 +00:00
Daniel P. Berrangé
4e5d903fc3 sanitytest: stop passing API XML path into sanity test
We want to move over to make sanitytest.py operate like a more normal
test script, which means making it self contained.

The test already knows how to find the libvirt API XML path using
pkg-config and if an override location is required, this can be done
by pointing $PKG_CONFIG_PATH to a suitable place.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 15:00:29 +00:00
Daniel P. Berrangé
b0e9f12f2f setup: switch from distutils to setuptools
The distutils package is deprecated and targetted for deletion in Python
3.12, so we need to switch to setuptools. Thanks to all the preceeding
changes this is no more difficult than changing the import statements.

Closes https://gitlab.com/libvirt/libvirt-python/-/issues/1
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
e00e8c39c2 setup: remove use of distutils.util.get_platform
The 'get_platform' function is used to determine the platform specific
component of the build output directory containing the loadable
modules and python code. There is no nice replacement for this
function, but we can achieve our goal by simply scaning for the desired
subdirectory, which should exist by the time 'test' runs.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
c230ecb483 setup: override 'build_ext' / 'build_py' commands rather than 'build'
We override the 'build' command to invoke the code generator before the
extensions are compiled. The 'build' command, however, is merely a
wrapper around several other commands. It is possible for the user to
directly invoke those commands, in which case our code generator won't
get a chance to run:

$ python setup.py build_ext
running build_ext
building 'libvirtmod' extension
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/build
gcc ..snip... -c build/libvirt.c -o build/temp.linux-x86_64-3.10/build/libvirt.o
cc1: fatal error: build/libvirt.c: No such file or directory
compilation terminated.
error: command '/usr/lib64/ccache/gcc' failed with exit code 1

To solve this we instead override 'build_ext' and 'build_py'. This in
turn means we call the generator to emit C code separately from Python
code.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
88067eda52 setup: replace distutils.dir_util.remove_tree with shutils
The distutils.dir_util.remove_tree method has no compelling benefit
over using the standard python shutils module.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
9d4b183b4e setup: replace distutils.spawn with subprocess
The distutils.spawn method has no compelling benefit over using the
standard python subprocess module.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
7d14f77224 setup: replace distutils.spawn.find_executable with shutils
The distutils.spawn.find_executable method has no compelling benefit
over using the standard python shutils module.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
49f0b4c16f setup: introduce an explicit check for pkg-config operation
Instead of searching for the pkg-config binary manually, just try to run
it and catch the exception raised if it isn't found. Use the --version
flag as a way to validate that it is at least somewhat functional.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
a965c91c6f setup: stop inheriting from 'clean' command
The default 'clean' command impl deletes only intermediate files from
the 'build' directory. We've overridden it to delete everything. There
is no benefit in inheriting from the default impl, given our subclass
will delete everything.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
6ea035b0e3 setup: drop the 'rpm' command
This duplicates funtionality already provided by the 'bdist_rpm'
command.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Jiri Denemark
fdd2034c1d Post-release version bump to 8.3.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-04-01 12:30:58 +02:00
Jiri Denemark
a80412bf8c Post-release version bump to 8.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-03-01 10:16:39 +01:00
Jiri Denemark
c19804df59 Post-release version bump to 8.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-01-14 15:17:49 +01:00
Jiri Denemark
2d36853d57 Post-release version bump to 8.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-12-01 10:53:47 +01:00
Jiri Denemark
a4eed6751b Post-release version bump to 7.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-11-01 13:23:27 +01:00
Jiri Denemark
aa0286fa6c Post-release version bump to 7.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-10-01 10:40:13 +02:00
Jiri Denemark
dd5e2d796e Post-release version bump to 7.8.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-09-01 13:47:00 +02:00
Jiri Denemark
3ec079df29 Post-release version bump to 7.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-08-02 12:28:43 +02:00
Jiri Denemark
f18d6b038e Post-release version bump to 7.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-07-01 15:44:56 +02:00
Jiri Denemark
7df337cad2 Post-release version bump to 7.5.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-06-01 12:08:38 +02:00
Jiri Denemark
23ea62992f Post-release version bump to 7.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-05-27 12:33:31 +00:00
Daniel P. Berrangé
38bb83e914 Don't run sanity checks by default
The sanity check scripts verify that the binding covers all APIs in the
libvirt library/headers being built against. This is primarily there for
libvirt maintainers to identify when there are gaps in API coverage.

This is not something downstream consumers of libvirt-python should be
running themselves, so we shouldn't added it to tests by default.

In addition if people are working on branches or submitting merge
requests for python changes, we shouldn't block their work for failed
API coverage sanity tests, if the python binding otherwise builds fine
and passes regular unit tests.

Thus, we introduce a new gitlab job "api-coverage" with some conditions:

 - If pushing to a branch, the job is treated as non-fatal
 - For regular scheduled builds, it is mandatory
 - Don't run in any other scenarios

This job uses the artifacts from the centos-8-git-build job and re-runs
the test suite, requesting the sanity tests to be run too.

This will achieve the result of letting us see missing API coverage
in nightly builds, without blocking other contributions.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-09 16:40:42 +01:00
Ján Tomko
a376a2abb0 setup: use pytest instead of nose to run the test suite
The software we use for running tests - nose - has been
deprecated in favor of nose2.

We don't use anything nose-specific, just unittest.TestCase,
which pytest can handle just fine.

Switch to using pytest, which we already use for libvirt-dbus.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-07 17:09:54 +02:00
Ján Tomko
98b9db087f setup: drop have_libvirtaio
This function says we have libvirtaio on Python >= 3.3,
however we already mandate Python >= 3.5 at the start of the file.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-07 16:25:45 +02:00
Jiri Denemark
5e96c84a37 Post-release version bump to 7.3.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-04-01 12:22:45 +02:00
Jiri Denemark
7e75a36b06 Post-release version bump to 7.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-03-01 11:59:46 +01:00
Jiri Denemark
53065adece Post-release version bump to 7.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-01-15 09:54:11 +01:00
Jiri Denemark
f49e204c28 Post-release version bump to 7.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-12-01 09:55:41 +01:00
Daniel P. Berrangé
991ecb5de8 Avoid truncating python version number when running sanity test
The current code assumes the version number string will be only three
characters long, which fails with "3.10".

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-12 13:34:14 +00:00
Jiri Denemark
2822e23156 Post-release version bump to 6.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-11-02 11:19:00 +01:00
Jiri Denemark
379a65bd68 Post-release version bump to 6.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-10-01 09:54:11 +02:00
Jiri Denemark
a1f2c432a8 Post-release version bump to 6.8.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-09-01 09:10:48 +02:00
Jiri Denemark
2966ed6085 Post-release version bump to 6.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-08-03 00:23:16 +02:00
Jiri Denemark
bf049af8f9 Post-release version bump to 6.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-07-23 00:43:16 +02:00
Daniel P. Berrangé
2ccc481c31 setup: post-release version bump to 6.5.0
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-08 16:43:39 +01:00