1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-05 08:59:36 +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

@ -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):