default to pic and helpful
[sddekit.git] / python / setup.py
blobba3cc1aa684e4bef1f466d6c64109acf1c004489
1 # copyright 2016 Apache 2 sddekit authors
3 import os
4 import glob
5 from distutils.core import setup
6 from distutils.extension import Extension
7 from Cython.Build import cythonize
8 import numpy as np
10 here = os.path.dirname(os.path.abspath(__file__))
11 up = os.path.dirname(here)
13 """
14 sources = []
15 for d, p in ((here, '*.pyx'), (up, 'src/*.c')):
16 sources += glob.glob(os.path.join(d, p))
18 exts = [Extension('hist',
19 sources=sources,
20 include_dirs=[
21 os.path.join(up, 'src'),
22 np.get_include()
26 """
28 c_sources = glob.glob(os.path.join(up, 'src/*.c'))
30 exts = []
32 for pyx_file in glob.glob(os.path.join(here, '*.pyx')):
33 exts.append(Extension(pyx_file.split('.pyx')[0],
34 sources=[pyx_file] + c_sources,
35 include_dirs=[
36 os.path.join(up, 'src'),
37 np.get_include()
42 setup(
43 name="sddekit",
44 ext_modules=cythonize(exts),