mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-29 14:56:21 +00:00
setup.py: Update for cython extension.
This commit is contained in:
parent
90a9e54a89
commit
51b53eb4a5
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/.idea
|
||||
/build
|
||||
/dist
|
||||
/setools.egg-info
|
||||
@ -6,8 +7,7 @@
|
||||
libqpol/policy_parse.c
|
||||
libqpol/policy_parse.h
|
||||
libqpol/policy_scan.c
|
||||
setools/policyrep/qpol_wrap.c
|
||||
setools/policyrep/qpol.py
|
||||
/setools/policyrep/libpolicyrep.c
|
||||
*.so
|
||||
|
||||
# Qt Generated Help files
|
||||
|
@ -7,6 +7,8 @@ include libqpol/include/qpol/*.h
|
||||
include man/*
|
||||
include qhc/*
|
||||
include setools/perm_map
|
||||
include setools/policyrep/*.pxi
|
||||
include setools/policyrep/libpolicyrep.pyx
|
||||
include setoolsui/*.ui
|
||||
include setoolsui/apol/*.ui
|
||||
include setoolsui/apol/apol.qhc
|
||||
|
@ -30,7 +30,7 @@ addition to the development packages from the above list:
|
||||
* bison
|
||||
* flex
|
||||
* libsepol 2.7+
|
||||
* SWIG 2.0.12+ or 3.0+ (3.0.8+ required for Python 3.5)
|
||||
* cython 0.27+
|
||||
|
||||
To run SETools unit tests, the following packages are required, in
|
||||
addition to the above dependencies:
|
||||
|
12
setup.py
12
setup.py
@ -12,6 +12,7 @@ import sys
|
||||
import os
|
||||
from os.path import join
|
||||
from contextlib import suppress
|
||||
from Cython.Build import cythonize
|
||||
|
||||
|
||||
class QtHelpCommand(Command):
|
||||
@ -107,8 +108,8 @@ if sys.platform.startswith('darwin'):
|
||||
else:
|
||||
macros=[]
|
||||
|
||||
ext_py_mods = [Extension('setools.policyrep._qpol',
|
||||
['setools/policyrep/qpol.i',
|
||||
ext_py_mods = [Extension('setools.policyrep.libpolicyrep',
|
||||
['setools/policyrep/libpolicyrep.pyx',
|
||||
'libqpol/avrule_query.c',
|
||||
'libqpol/bool_query.c',
|
||||
'libqpol/bounds_query.c',
|
||||
@ -155,14 +156,11 @@ ext_py_mods = [Extension('setools.policyrep._qpol',
|
||||
'-Wnested-externs',
|
||||
'-Wold-style-definition',
|
||||
'-Wpointer-arith',
|
||||
'-Wredundant-decls',
|
||||
'-Wstrict-prototypes',
|
||||
'-Wunknown-pragmas',
|
||||
'-Wwrite-strings',
|
||||
'-Wno-missing-field-initializers', # SWIG 3.0.2 generates partially-initialized structs
|
||||
'-Wno-unused-parameter', # SWIG generates functions with unused parameters
|
||||
'-Wno-sign-compare', # Bison
|
||||
'-Wno-cast-qual', # libsepol uses const-to-nonconst casts
|
||||
'-Wno-shadow', # SWIG generates shadow variables
|
||||
'-Wno-unreachable-code', # Bison generates unreachable code
|
||||
'-fno-exceptions'],
|
||||
swig_opts=['-Ilibqpol/include'],
|
||||
@ -183,7 +181,7 @@ setup(name='setools',
|
||||
scripts=['apol', 'sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta'],
|
||||
data_files=[(join(sys.prefix, 'share/man/man1'), glob.glob("man/*.1"))],
|
||||
package_data={'': ['*.ui', '*.qhc', '*.qch'], 'setools': ['perm_map']},
|
||||
ext_modules=ext_py_mods,
|
||||
ext_modules=cythonize(ext_py_mods),
|
||||
test_suite='tests',
|
||||
license='GPLv2+, LGPLv2.1+',
|
||||
classifiers=[
|
||||
|
3
tox.ini
3
tox.ini
@ -20,6 +20,7 @@ commands = pep8 --version
|
||||
[testenv:coverage]
|
||||
deps = networkx==2.0
|
||||
coverage
|
||||
cython>=0.27
|
||||
commands = coverage --version
|
||||
coverage erase
|
||||
coverage run setup.py test
|
||||
@ -28,6 +29,7 @@ commands = coverage --version
|
||||
[testenv:lint]
|
||||
deps = pylint
|
||||
networkx==2.0
|
||||
cython>=0.27
|
||||
commands = {envpython} setup.py build_ext -i
|
||||
pylint --version
|
||||
pylint -E --rcfile .pylintrc setools tests seinfo seinfoflow sedta sesearch sediff
|
||||
@ -36,5 +38,6 @@ commands = {envpython} setup.py build_ext -i
|
||||
|
||||
[testenv]
|
||||
deps = networkx==2.0
|
||||
cython>=0.27
|
||||
commands = {envpython} setup.py test
|
||||
recreate = True
|
||||
|
Loading…
Reference in New Issue
Block a user