diff --git a/pyproject.toml b/pyproject.toml index 08e61a33..37e8226f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,70 @@ [build-system] -requires = ["setuptools", "Cython>=0.27"] +# setup also requires libsepol and libselinux +# C libraries and headers to compile. +requires = ["setuptools", "Cython>=0.29.14"] build-backend = "setuptools.build_meta" +[project] +name = "setools" +version = "4.6.0.dev" +description="SELinux policy analysis tools." +authors = [{name = "Chris PeBenito", email="pebenito@ieee.org"}] +readme = {file = "README.md", content-type = "text/markdown"} +urls.Homepage = "https://github.com/SELinuxProject/setools" +urls.Repository = "https://github.com/SELinuxProject/setools.git" +urls."Bug Tracker" = "https://github.com/SELinuxProject/setools/issues" + +keywords = ["SELinux", + "SETools", + "policy", + "analysis", + "seinfo", + "sesearch", + "sediff", + "sedta", + "seinfoflow", + "apol"] + +# https://pypi.org/classifiers/ +classifiers = ["Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Environment :: X11 Applications :: Qt", + "Intended Audience :: Information Technology", + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", + "Programming Language :: Cython", + "Topic :: Security", + "Topic :: Utilities", + "Typing :: Typed"] + +requires-python=">=3.10" +# also requires libsepol.so and libselinux.so. +dependencies = ["setuptools"] + +optional-dependencies.analysis = ["networkx>=2.6", + "pygraphviz"] +optional-dependencies.gui = ["PyQt6"] +optional-dependencies.test = ["tox"] + +[tool.setuptools] +include-package-data = false +script-files = ["apol", + "sediff", + "seinfo", + "seinfoflow", + "sesearch", + "sedta", + "sechecker"] + +[tool.setuptools.packages.find] +include = ["setools*"] + +[tool.setuptools.package-data] +"*" = ["*.css", "*.html", "perm_map", "py.typed"] + +[tool.setuptools.exclude-package-data] +"*" = ["*.c", "*.pyi", "*.pyx"] + # # Coverage config diff --git a/setup.py b/setup.py index a58114ef..3df21c72 100644 --- a/setup.py +++ b/setup.py @@ -64,42 +64,11 @@ if lang and os.path.exists(join("man", lang)): installed_data.append((join('share/man', lang, 'man1'), glob.glob(join("man", lang, "*.1")))) -setup(name='setools', - version='4.6.0-dev', - description='SELinux policy analysis tools.', - author='Chris PeBenito', - author_email='pebenito@ieee.org', - url='https://github.com/SELinuxProject/setools', - packages=['setools', 'setools.checker', 'setools.diff', 'setoolsgui', 'setoolsgui.widgets', - 'setoolsgui.widgets.criteria', 'setoolsgui.widgets.details', - 'setoolsgui.widgets.models', 'setoolsgui.widgets.views'], - scripts=['apol', 'sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta', 'sechecker'], - data_files=installed_data, - package_data={'': ['*.html'], - 'setools': ['perm_map', 'policyrep.pyi', 'py.typed']}, +# see pyproject.toml for most package options. +setup(data_files=installed_data, ext_modules=cythonize(ext_py_mods, include_path=['setools/policyrep'], annotate=cython_annotate, compiler_directives={"language_level": 3, "c_string_type": "str", "c_string_encoding": "ascii", - "linetrace": enable_coverage}), - test_suite='tests', - license='GPLv2+, LGPLv2.1+', - classifiers=[ - 'Environment :: Console', - 'Environment :: X11 Applications :: Qt', - 'Intended Audience :: Information Technology', - 'Topic :: Security', - 'Topic :: Utilities', - ], - keywords='SELinux SETools policy analysis tools seinfo sesearch sediff sedta seinfoflow apol', - python_requires='>=3.10', - # setup also requires libsepol and libselinux - # C libraries and headers to compile. - setup_requires=['setuptools', 'Cython>=0.29.14'], - install_requires=['setuptools'], - extras_require={ - "analysis": ["networkx>=2.6", "pygraphviz"], - "test": "tox" - } - ) + "linetrace": enable_coverage}))