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