setup.py
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
import numpy
from sklearn._build_utils import gen_from_templates
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linear_model', parent_package, top_path)
libraries = []
if os.name == 'posix':
libraries.append('m')
config.add_extension('_cd_fast',
sources=['_cd_fast.pyx'],
include_dirs=numpy.get_include(),
libraries=libraries)
config.add_extension('_sgd_fast',
sources=['_sgd_fast.pyx'],
include_dirs=numpy.get_include(),
libraries=libraries)
# generate sag_fast from template
templates = ['sklearn/linear_model/_sag_fast.pyx.tp']
gen_from_templates(templates, top_path)
config.add_extension('_sag_fast',
sources=['_sag_fast.pyx'],
include_dirs=numpy.get_include())
# add other directories
config.add_subpackage('tests')
config.add_subpackage('_glm')
config.add_subpackage('_glm/tests')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())