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

setup: Query library version out of a file

This makes it possible to programatically query the version in any
stage of the build process, including Makefile etc.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Erik Skultety 2023-06-08 10:57:15 +02:00
parent 8c3eb73631
commit 390cadccc0
4 changed files with 9 additions and 2 deletions

View File

@ -5,6 +5,7 @@ include AUTHORS
include COPYING
include CONTRIBUTING.rst
include HACKING
include VERSION
include requirements-test.txt
include tox.ini
include Makefile

1
VERSION Normal file
View File

@ -0,0 +1 @@
9.5.0

View File

@ -1,6 +1,6 @@
[metadata]
name = libvirt-python
version = 9.5.0
version = file: VERSION
description = The libvirt virtualization API python binding
long_description = file: README
long_description_content_type = text/x-rst

View File

@ -14,6 +14,11 @@ from setuptools.command.build_py import build_py
from setuptools.command.sdist import sdist
def getVersion():
with open("VERSION") as f:
return f.read().strip()
def check_pkgcfg():
try:
proc = subprocess.run(["pkg-config", "--version"],
@ -195,7 +200,7 @@ class my_sdist(sdist):
return self._gen_from_in("libvirt-python.spec.in",
"libvirt-python.spec",
"@PY_VERSION@",
self.distribution.get_version())
getVersion())
def gen_authors(self):