1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-12 17:49:25 +03:00
Commit Graph

145 Commits

Author SHA1 Message Date
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
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
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
b9f79758c9 tests: add libvirtaio test coverage
Signed-off-by: Chris Gunn <chrisgun@microsoft.com>
2022-06-08 16:43:52 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
11805dd7a6 setup: post-release version bump to 6.4.0
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-05 12:08:51 +01:00
4c7fc59e0a Release of libvirt-python 6.3.0
* setup.py: updated for the release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
2020-05-05 08:52:25 +02:00
4252e827e0 setup: require python >= 3.5 to build
Python 3.5 is the oldest Python version available across our supported
build platforms.

Reviewed-by: Philipp Hahn <hahn@univention.de>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-04-22 11:05:11 +01:00
85c5243497 Release of libvirt-python 6.2.0
* setup.py: bumped version to 6.2.0

Signed-off-by: Daniel Veillard <veillard@redhat.com>
2020-04-02 21:26:41 +02:00
af65786ef5 Release of libvirt-python 6.1.0
* setup.py : updated for release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
2020-03-03 14:53:15 +01:00
ae8e5b1de6 Release of libvirt-python-6.0.0
* setup.py: updated for the release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
2020-01-15 16:23:53 +01:00
5efdfd042c setup: Accept 'nosetests3' as nosetests binary
This is the name used on Ubuntu.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-12-09 16:14:10 +01:00