1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2024-10-26 07:55:06 +03:00
Commit Graph

44 Commits

Author SHA1 Message Date
Michal Privoznik
533399d186 setup.py: s/PY_VERSION/VERSION/
When generating spec file, @PY_VERSION@ is replaced with the
current version of libvirt-python. Well, it's not as obvious as
it could be: usually it's just @VERSION@. Worse, the PY_ prefix
may mislead readers into thinking it refers to python version.

Just drop the PY_ prefix.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2024-05-02 12:50:16 +00:00
Erik Skultety
8d89f932e7 spec: Invoke pytest properly
With all the bits in place we can now drop the 'setup.py' invocations
with preferred alternatives. The way to do this in a SPEC file is to
use either of the following macros: %tox or %pytest - both of which
automatically set paths for the test suite correctly which is
something we used to do ourselves in our implementation of the
setup.py's test command originally.
That is wrong and with the migration to PEP-517 compliant builds it
also won't work anymore properly, because there'd be no libs to import
by mangling PYTHONPATH, we'd only get an sdist or a wheel, or in case
of rpmbuild a preset buildroot environment.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-06-22 10:52:40 +02:00
Erik Skultety
5e2d7df5e7 COPYING: Only ship a single license file COPYING
The correct license we've used for a while is LGPLv2+, so drop the
original.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-06-08 09:52:47 +02:00
Daniel P. Berrangé
f8bcbbcf65 rpm: convert license to SPDX format
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-04-26 13:23:11 +01:00
Daniel P. Berrangé
082d69ee50 rpm: add explicit build dep on python3-setuptools
We previously got this implicitly via a dep from python3-pytest
so never noticed that it was missing. The implicit dep is going
away in rawhide real soon.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-11-23 12:24:29 +00:00
Daniel P. Berrangé
5d7bd23980 rpm: drop support for RHEL-7
We no longer support libvirt on this distro

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-01 18:33:28 +01:00
Ján Tomko
80ed19052f spec: use pytest instead of nose
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-12 17:39:22 +00:00
Daniel P. Berrangé
220818affc rpm: use HTTPS for URLs
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-12 18:12:48 +01:00
Daniel P. Berrangé
54e99c9ec4 Drop largely empty and unused NEWS file
We bundle a git generated ChangeLog file in the dist, and never add
any entries to the NEWS file.

Fixes #2
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-14 10:43:41 +01:00
Daniel P. Berrangé
c7239ca55b Fix RPM deps for centos 7
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-12-06 13:25:29 +00:00
Daniel P. Berrangé
b22e4f2441 Drop support for python 2
python2 will be end of life by the time of the next
libvirt release. All our supported build targets, including
CentOS7, have a python3 build available.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-12-04 12:14:51 +00:00
Nir Soffer
9dc11ea157 spec: Build python2 package in fedora < 31
Since commit ee0cfbe65c (spec: Unconditionally build python2 on
Fedora) python2-libvirt is not built on any Fedora version.

Fix the spec to drop python2-libvirt on Fedora 31.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2019-09-03 10:42:36 -04:00
Cole Robinson
5e9d1aa7fa spec: Bump minimum supported Fedora version to 29
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-09 19:11:20 -04:00
Cole Robinson
ee0cfbe65c spec: Unconditionally build python2 on Fedora
In Fedora we are currently shipping python2 bindings for all builds,
so this conditional is out of date. Fedora 31 may be the time that
python2 bindings are dropped:

https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal

But I think it's better to wait for that to actually happen before
we change this again

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-09 19:11:20 -04:00
Daniel P. Berrangé
da3391a135 rpm: use new python macros for build/install rules
The new %py{2,3}_{build,install} macros ensure that the right compiler
and linker flags are used when building python modules.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-04-04 12:37:23 +01:00
Daniel P. Berrangé
8bd4c9374a rpm spec: remove %{extra_release} from spec
The %{extra_release} field was previously populated by data from the old
autobuild.sh file but is no longer used.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-01-22 11:20:04 +00:00
Daniel P. Berrangé
7b4d676065 rpm: update min required rhel/fedora
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-23 14:10:58 +01:00
Daniel P. Berrangé
cc55ae62d7 rpm: add BuildRequires on gcc
The gcc RPM is no longer part of the default build root.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-23 14:10:56 +01:00
Daniel P. Berrangé
5ca2cb0018 rpm: use the versioned python2 macro names
The use of non-versioned python2 macro names is deprecated in Fedora

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-23 14:10:37 +01:00
Cole Robinson
2efd1e9ab2 spec: Remove Group: and %defattr
These are only needed for RHEL5 builds, which are no longer supported

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/CMCUBB4SWS3URHTRRS3OPFM4HF5CGKBW/
https://fedoraproject.org/wiki/RPMGroups

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-07-10 13:34:44 -04:00
Daniel P. Berrangé
74eab13a2b Disable Python 2 on future RHEL and Fedora > 29
The end of Python 2 is nearing, so declare when it will be removed
from libvirt Python binding RPMs.

NB, this doesn't imply we'll be removing py2 support from upstream
libvirt-python on the same timeframe - we'll consider what todo
wrt that when upstream Python 2 finally goes EOL.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-23 15:18:51 +00:00
Daniel P. Berrange
6a9905cc97 Use python*_sitearch macros instead of manually defining the dir
Note we use python_sitearch not python2_sitearch, since the former
is more portable.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:16:01 +00:00
Daniel P. Berrange
7cb4a80387 Fix filtering of RPM provides for .so files
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:57 +00:00
Daniel P. Berrange
948d77335e Require libvirt native version matching py version by default
Although we're capable of building against any libvirt >= 0.9.11, 99% of the
time we want RPM builds to be done against matching libvirt version, otherwise
we might silently build against an unexpected/wrong version.

We don't support building against a native libvirt that's newer than the
python binding, since the generator may incorrectly handle new APIs. So use
== instead of >= too.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:54 +00:00
Daniel P. Berrange
d11f4e4199 Turn on python3 sub-RPMs for RHEL > 7
It is expected that future RHEL-8 will have python3 by default, so enable that.
It is unclear whether python2 will still be available, so leave that enabled
for now.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:52 +00:00
Daniel P. Berrange
8dfa907b2f Adapt to rename of py2 RPMs from python- to python2- prefix
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:50 +00:00
Daniel P. Berrange
53a6d49660 Add emacs mode marker to activate rpm-spec highlighting
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:49 +00:00
Daniel P. Berrange
f6ea01496a Add checks for min supported distros
Be clear about which distros we aim to support with the specfile, so we know
what we can cleanup in the spec later.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:45 +00:00
Daniel P. Berrange
7cde26caa9 Allow override of which sub-RPMs to build
Allow using

  rpmbuild --define "with_python2 0"

to override the default logic about which python sub-RPMs to build

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:43 +00:00
Daniel P. Berrange
ba234bd831 Allow disabling of python2 RPM build
With Fedora modularity, it is possible to have add-on repos for multiple
versions of python3. It is thus desirable to be able to build libvirt-python
in these repos, with only the python3 sub-RPMs enabled.

Thus also helps if future RHEL/Fedora drop python2 entirely from their default
repos.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:27 +00:00
Daniel P. Berrange
abce5971b2 Change Obsoletes to an explicit version
We only want to obsolete versions which actually had the
original name, not all future versions.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-09-04 13:13:53 +01:00
Daniel P. Berrange
49cb00a5eb Fix package name in description of sub-RPMs
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-10 12:12:24 +01:00
Daniel P. Berrange
a2e3bb8ea7 Revert "rpm: assume python3 is always available"
This reverts commit b302b6d884.

Only drop the Fedora 18 test - RHEL must still build without
python 3
2017-08-10 12:11:40 +01:00
Daniel P. Berrange
bbfea06114 rpm: rename packages to python2-libvirt / python3-libvirt
This complies with Fedora naming policy for python packages

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-10 10:36:26 +01:00
Daniel P. Berrange
b302b6d884 rpm: assume python3 is always available
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-10 10:36:19 +01:00
Martin Kletzander
7695aa5a3b spec: Install egg-info with rpm package
This was being done due to now deprecated policy and that file should
be installed so that pip can recognize that the packages is already
installed in the system.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2017-05-15 17:58:25 +02:00
Wojtek Porczyk
e985010674 Add asyncio event loop implementation
This is usable only on python >= 3.4 (or 3.3 with out-of-tree asyncio),
however it should be harmless for anyone with older python versions.

In simplest case, to have the callbacks queued on the default loop:

    >>> import libvirtaio
    >>> libvirtaio.virEventRegisterAsyncIOImpl()

The function is not present on non-compatible platforms.

Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
2017-04-04 15:28:50 +01:00
Cole Robinson
8067f0bed0 spec: Don't pull in dependencies for example scripts
If the scripts are marked as executable, RPM magic will scan them
for dependencies, which can pull in python2 for the python3 package
2016-04-20 14:47:48 -04:00
Jiri Denemark
e715a1c86b spec: Reorganize to satisfy buggy spectool
spectool parses a specfile and strips everything but a preamble.
However, if the first section is preceded by %if clause, it keeps it
there which then makes rpmbuild complain about unmatched %if. Let's make
the buggy tool happy by moving sections around so that the first one is
not in any conditional.
2014-07-29 16:24:48 +02:00
Laine Stump
959629a801 build: add BuildRequires for python-lxml and python3-lxml
python-lxml is likely always already present anyway (due to so many
packages being dependent on it), but at least on my F20 system,
python3-lxml wasn't installed, leading to a failure of "python
setup.py rpm" without an informative error message.
2014-04-07 15:33:24 +03:00
Daniel P. Berrange
0eaf951979 Fix nosetests usage with python3
Add RPM deps on python/python3-nose, make RPM build run the
test suite and invoke nosetests using correct python binary

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-04-02 16:33:53 +02:00
Daniel P. Berrange
c95c635d9b Add python3 to the automated build and RPM
This updates autobuild.sh to test the python3 build process.
The RPM specfile is changed to build a libvirt-python3 RPM
on Fedora > 18

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-12-12 11:26:11 +00:00
Daniel P. Berrange
b9579cb6fd Fix misc RPM specfile flaws
Fix the RPM summary line, add placeholder %changelog tag,
make %setup quiet, add Url: tag and filter out bogus
provides and add example programs as docs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-28 11:54:02 +00:00
Daniel P. Berrange
41562e063e Setup distutils build system
Create a setup.py for building libvirt python code and add
supporting files

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-22 15:58:06 +00:00