-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
69 lines (54 loc) · 1.95 KB
/
setup.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
"""
setup.py file
"""
# import sys
import sysconfig
from setuptools import setup
from setuptools.extension import Extension
from setuptools.command.build_ext import build_ext
libraries = ['gsl', 'gslcblas']
if sysconfig.get_config_var("LIBM") == "-lm":
libraries.append("m")
include_dirs = ['/usr/local/include', '/usr/include', 'c/']
library_dirs = ['/usr/local/lib', 'usr/lib']
sources = ['c/pysbrl.c', 'c/train.c', 'c/rulelib.c', 'c/save_load.c',
'c/bit_vector.c', 'c/utils.c', 'swig/sbrl_wrap.c']
pysbrl_module = Extension('_sbrl',
sources=sources,
include_dirs=include_dirs,
libraries=libraries,
library_dirs=library_dirs,
swig_opts=['-keyword'],
# extra_link_args=["-shared"],
extra_compile_args=['-std=c99']
)
class CustomBuildExtCommand(build_ext):
"""build_ext command for use when numpy headers are needed."""
def run(self):
# Import numpy here, only when headers are needed
import numpy
# Add numpy headers to include_dirs
self.include_dirs.append(numpy.get_include())
# Call original build_ext command
build_ext.run(self)
setup(
name='pysbrl',
version='0.4.2',
author="Yao, Ming",
description="""A python interface of Scalable Bayesian Rule List""",
long_description="PySBRL is a python package that allows you to create rule lists from categorical data",
ext_modules=[pysbrl_module],
url='https://github.com/myaooo/pysbrl',
packages=["pysbrl"],
# requires=['numpy'],
cmdclass={'build_ext': CustomBuildExtCommand},
install_requires=[
'numpy>=1.13'
'fim',
],
dependency_links=[
'https://github.com/myaooo/pyfim-clone/tarball/master#egg=fim-6.28'
]
# extra_link_args = ["-bundle"],
)