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:
@ -5,6 +5,7 @@ include AUTHORS
|
|||||||
include COPYING
|
include COPYING
|
||||||
include CONTRIBUTING.rst
|
include CONTRIBUTING.rst
|
||||||
include HACKING
|
include HACKING
|
||||||
|
include VERSION
|
||||||
include requirements-test.txt
|
include requirements-test.txt
|
||||||
include tox.ini
|
include tox.ini
|
||||||
include Makefile
|
include Makefile
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = libvirt-python
|
name = libvirt-python
|
||||||
version = 9.5.0
|
version = file: VERSION
|
||||||
description = The libvirt virtualization API python binding
|
description = The libvirt virtualization API python binding
|
||||||
long_description = file: README
|
long_description = file: README
|
||||||
long_description_content_type = text/x-rst
|
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
|
from setuptools.command.sdist import sdist
|
||||||
|
|
||||||
|
|
||||||
|
def getVersion():
|
||||||
|
with open("VERSION") as f:
|
||||||
|
return f.read().strip()
|
||||||
|
|
||||||
|
|
||||||
def check_pkgcfg():
|
def check_pkgcfg():
|
||||||
try:
|
try:
|
||||||
proc = subprocess.run(["pkg-config", "--version"],
|
proc = subprocess.run(["pkg-config", "--version"],
|
||||||
@ -195,7 +200,7 @@ class my_sdist(sdist):
|
|||||||
return self._gen_from_in("libvirt-python.spec.in",
|
return self._gen_from_in("libvirt-python.spec.in",
|
||||||
"libvirt-python.spec",
|
"libvirt-python.spec",
|
||||||
"@PY_VERSION@",
|
"@PY_VERSION@",
|
||||||
self.distribution.get_version())
|
getVersion())
|
||||||
|
|
||||||
def gen_authors(self):
|
def gen_authors(self):
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user