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:
7
setup.py
7
setup.py
@ -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):
|
||||
|
||||
|
Reference in New Issue
Block a user