Skip to content

Commit

Permalink
setup.py: Move static definitions to pyproject.toml.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris PeBenito <[email protected]>
  • Loading branch information
pebenito committed Apr 22, 2024
1 parent 0f7a123 commit 2e6a04f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 35 deletions.
65 changes: 64 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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="[email protected]"}]
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
Expand Down
37 changes: 3 additions & 34 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
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}))

0 comments on commit 2e6a04f

Please sign in to comment.