diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2017-10-06 16:44:11 +0200 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2017-10-06 16:44:11 +0200 |
| commit | ba0225b7ab0556b2019935d5f5786863c0a01e6a (patch) | |
| tree | 42c89e4d5d863f8498c1efa9cd5d25da0e240480 /setup.py | |
| download | pygensvm-ba0225b7ab0556b2019935d5f5786863c0a01e6a.tar.gz pygensvm-ba0225b7ab0556b2019935d5f5786863c0a01e6a.zip | |
initial commit
Diffstat (limited to 'setup.py')
| -rw-r--r-- | setup.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6d369ef --- /dev/null +++ b/setup.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import numpy + +from numpy.distutils.core import setup +from numpy.distutils.misc_util import Configuration +from sklearn._build_utils import get_blas_info, maybe_cythonize_extensions + + +def configuration(parent_package='', top_path=None): + config = Configuration('gensvm', parent_package, top_path) + + # gensvm module + cblas_libs, blas_info = get_blas_info() + if os.name == 'posix': + cblas_libs.append('m') + + gensvm_sources = [ + os.path.join('gensvm', 'pyx_gensvm.pyx'), + os.path.join('gensvm', 'src', 'gensvm', 'src', '*.c'), + ] + + gensvm_depends = [ + os.path.join('gensvm', 'src', 'gensvm', 'include', '*.h'), + os.path.join('gensvm', 'src', 'gensvm', 'gensvm_helper.c') + ] + + config.add_extension('pyx_gensvm', + sources=gensvm_sources, + libraries=cblas_libs, + include_dirs=[ + os.path.join('gensvm', 'src', 'gensvm'), + os.path.join('gensvm', 'src', 'gensvm', 'include'), + numpy.get_include(), + blas_info.pop('include_dirs', [])], + extra_compile_args=blas_info.pop('extra_compile_args', []), + depends=gensvm_depends, + **blas_info) + # end gensvm module + + maybe_cythonize_extensions(top_path, config) + + return config + + +def read(fname): + return open(os.path.join(os.path.dirname(__file__), fname)).read() + + +if __name__ == '__main__': + + version = re.search("__version__ = '([^']+)'", + open('gensvm/__init__.py').read()).group(1) + + attr = configuration(top_path='').todict() + + attr['description'] = 'Python package for the GenSVM classifier' + attr['long_description'] = read('README.rst') + attr['packages'] = ['gensvm'] + attr['url'] = "https://github.com/GjjvdBurg/PyGenSVM" + attr['author'] = "G.J.J. van den Burg" + attr['author_email'] = "gertjanvandenburg@gmail.com" + attr['license'] = 'GPL v2' + attr['install_requires'] = ['scikit-learn', 'numpy'] + + setup(**attr) |
