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:
parent
8c3eb73631
commit
390cadccc0
@ -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,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
|
||||
|
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):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user