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

Move declarative stuff out of setup.py to setup.cfg

So, why using setup.cfg if pyproject.toml is the new best thing
recommended everywhere? Well, quite a few of the fields we use with
setuptools are setuptools-specific and haven't been introduced as
keywords to pyproject.toml yet. There is a chance that these fields
could be added via a dedicated 'tool.setuptools' TOML section, but none
of it is officially documented and so it would be BETA at best anyway.
Let's not try our luck and use a declarative config file tailored
specifically to setuptools - setup.cfg. It's also unlikely we'd switch
from setuptools to something else in the near future given the nature
of building this project (i.e. building with C modules) and if so, it
would likely not be a PyPa recommended PEP-517 compliant build
system anyway, e.g. meson, so we're totally fine doing this.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Erik Skultety
2023-06-06 14:01:57 +02:00
parent 68c9acbd3a
commit 8c3eb73631
2 changed files with 33 additions and 30 deletions

20
setup.cfg Normal file
View File

@ -0,0 +1,20 @@
[metadata]
name = libvirt-python
version = 9.5.0
description = The libvirt virtualization API python binding
long_description = file: README
long_description_content_type = text/x-rst
url = http://www.libvirt.org
maintainer = Libvirt Maintainers
maintainer_email = libvir-list@redhat.com
license_files = COPYING
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Programming Language :: Python :: 3 :: Only
[options]
python_requires = >=3.6
package_dir =
=build

View File

@ -361,34 +361,17 @@ check_pkgcfg()
_c_modules, _py_modules = get_module_lists() _c_modules, _py_modules = get_module_lists()
setup(name="libvirt-python", setup(
version="9.5.0", ext_modules=_c_modules,
url="http://www.libvirt.org", py_modules=_py_modules,
maintainer="Libvirt Maintainers", package_dir={
maintainer_email="libvir-list@redhat.com", '': 'build'
description="The libvirt virtualization API python binding", },
long_description= cmdclass={
"""The libvirt-python package provides a module that permits applications "build_ext": my_build_ext,
written in the Python 3.x programming language to call the interface "build_py": my_build_py,
supplied by the libvirt library, to manage the virtualization capabilities "clean": my_clean,
of recent versions of Linux (and other OSes).""", "sdist": my_sdist,
license="LGPLv2+", "test": my_test
ext_modules=_c_modules, },
py_modules=_py_modules,
package_dir={
"": "build"
},
cmdclass={
"build_ext": my_build_ext,
"build_py": my_build_py,
"clean": my_clean,
"sdist": my_sdist,
"test": my_test
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
"Programming Language :: Python :: 3",
]
) )