-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
44 lines (40 loc) · 1.36 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
# Example I followed:
# https://github.com/SeTeM/pync/blob/master/setup.py
import os
import numpy as np
from Cython.Build import cythonize
from setuptools import setup, Extension
file_contents = []
for file_name in ('README.md',):
path = os.path.join(os.path.dirname(__file__), file_name)
file_contents.append(open(path).read())
long_description = '\n\n'.join(file_contents)
wrapper = Extension(
name='ckmeans._ckmeans_wrapper',
sources=[
'ckmeans/_ckmeans_wrapper.pyx',
'Ckmeans.1d.dp/src/Ckmeans.1d.dp.cpp',
'Ckmeans.1d.dp/src/select_levels.cpp',
'Ckmeans.1d.dp/src/weighted_opt_uni_kmeans.cpp',
'Ckmeans.1d.dp/src/weighted_select_levels.cpp'
],
language="c++",
include_dirs=['Ckmeans.1d.dp/src', np.get_include()],
extra_compile_args=['-std=c++11']
)
setup(
name='ckmeans',
version='1.1.1',
description='Python wrapper around Ckmeans.1d.dp',
long_description=long_description,
author='Greg Werbin',
author_email='[email protected]',
license='MIT',
packages=['ckmeans'],
ext_modules = cythonize(wrapper),
install_requires=['numpy', 'Cython'],
# how to specify R and Ckmeans.1d.dp as well? info at section `test_loader`
# on http://pythonhosted.org/setuptools/setuptools.html#command-reference
tests_require=['rpy2'],
test_suite='tests.ckmeans.ckmeans_test'
)