1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-03 08:21:58 +03:00

setup: styling: Don't mix top-level code with function/class definition

It hinders readability so much when the top-level code that gets
executed right away when setup.py is loaded is mixed in between type
definitions.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Erik Skultety
2023-06-07 17:13:31 +02:00
parent ad6a3343b7
commit 8c9bc5d2d0

View File

@ -15,18 +15,6 @@ from setuptools.command.build_py import build_py
from setuptools.command.sdist import sdist
if sys.version_info < (3, 6):
print("libvirt-python requires Python >= 3.6 to build")
sys.exit(1)
MIN_LIBVIRT = "0.9.11"
MIN_LIBVIRT_LXC = "1.0.2"
# Hack to stop 'pip install' failing with error
# about missing 'build' dir.
if not os.path.exists("build"):
os.mkdir("build")
def check_pkgcfg():
try:
proc = subprocess.run(["pkg-config", "--version"],
@ -39,8 +27,6 @@ def check_pkgcfg():
print("pkg-config binary is required to compile libvirt-python")
sys.exit(1)
check_pkgcfg()
def check_minimum_libvirt_version():
subprocess.check_call(["pkg-config",
@ -354,6 +340,20 @@ class my_clean(Command):
# Invoke setup() #
##################
if sys.version_info < (3, 6):
print("libvirt-python requires Python >= 3.6 to build")
sys.exit(1)
MIN_LIBVIRT = "0.9.11"
MIN_LIBVIRT_LXC = "1.0.2"
# Hack to stop "pip install" failing with error
# about missing "build" dir.
if not os.path.exists("build"):
os.mkdir("build")
check_pkgcfg()
_c_modules, _py_modules = get_module_lists()
setup(name="libvirt-python",