6
6
from Cython .Build import cythonize
7
7
from setuptools import Extension , setup
8
8
9
- sources = ["pycrfsuite/_pycrfsuite.pyx" ,
10
- "pycrfsuite/trainer_wrapper.cpp" ]
9
+ sources = ["pycrfsuite/_pycrfsuite.pyx" , "pycrfsuite/trainer_wrapper.cpp" ]
11
10
12
11
# crfsuite
13
12
sources += glob .glob ("crfsuite/lib/crf/src/*.c" )
@@ -34,12 +33,17 @@ def build_extensions(self):
34
33
_compile = c ._compile
35
34
36
35
def c_compile (obj , src , ext , cc_args , extra_postargs , pp_opts ):
37
- cc_args = cc_args + ["-D_POSIX_C_SOURCE=200112L" ] if src .startswith ("crfsuite/" ) else cc_args
36
+ cc_args = (
37
+ cc_args + ["-D_POSIX_C_SOURCE=200112L" ]
38
+ if src .startswith ("crfsuite/" )
39
+ else cc_args
40
+ )
38
41
cc_args = cc_args + ["-std=c99" ] if src .endswith (".c" ) else cc_args
39
42
return _compile (obj , src , ext , cc_args , extra_postargs , pp_opts )
40
43
41
- if c .compiler_type == "unix" and \
42
- any (item == "gcc" or item .endswith ("-gcc" ) for item in c .compiler ):
44
+ if c .compiler_type == "unix" and any (
45
+ item == "gcc" or item .endswith ("-gcc" ) for item in c .compiler
46
+ ):
43
47
c ._compile = c_compile
44
48
45
49
elif self .compiler .compiler_type == "msvc" :
@@ -60,5 +64,5 @@ def c_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
60
64
)
61
65
]
62
66
),
63
- cmdclass = {"build_ext" : build_ext_check_gcc }
67
+ cmdclass = {"build_ext" : build_ext_check_gcc },
64
68
)
0 commit comments