-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
57 lines (47 loc) · 1.38 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
from __future__ import print_function
import os
from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
import numpy
import bnp
with open('requirements.txt') as f:
INSTALL_REQUIRES = [l.strip() for l in f.readlines() if l]
try:
import numpy
except ImportError:
print('numpy is required during installation')
sys.exit(1)
try:
import scipy
except ImportError:
print('scipy is required during installation')
sys.exit(1)
libraries = []
if os.name == 'posix':
libraries.append('m')
extensions = [
Extension("bnp.utils.fast_expectation",
["bnp/utils/fast_expectation.pyx"],
include_dirs=[numpy.get_include()],
libraries=libraries),
Extension("bnp.utils.extmath",
["bnp/utils/extmath.pyx"],
include_dirs=[numpy.get_include()],
libraries=libraries),
]
setup(
name='bnp',
version=bnp.__version__,
url='https://github.com/chyikwei/bnp/',
ext_modules=cythonize(extensions),
cmdclass={'build_ext': build_ext},
test_suite='nose.collector',
tests_require=['nose'],
install_requires=INSTALL_REQUIRES,
packages=['bnp', 'bnp.utils'],
author='Chyi-Kwei Yau',
author_email='chyikwei.yau@gmail.com',
description='Bayesian Nonparametric models with Python'
)