From 9a2471612551bb07726a9afc97fac5f3b704cc41 Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Tue, 4 Nov 2014 12:20:07 +0100 Subject: fixed setup for travis test runs --- setup.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3bae9d5..eaef7e1 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ Distributed under the BSD License """ from setuptools import setup, find_packages from distutils.extension import Extension +import os.path import numpy try: @@ -20,20 +21,27 @@ except ImportError: else: use_cython = True +if os.path.isfile("pyspike/cython_add.c") and \ + os.path.isfile("pyspike/cython_distance.c"): + use_c = True +else: + use_c = False + cmdclass = {} ext_modules = [] -if use_cython: +if use_cython: # Cython is available, compile .pyx -> .c ext_modules += [ Extension("pyspike.cython_add", ["pyspike/cython_add.pyx"]), Extension("pyspike.cython_distance", ["pyspike/cython_distance.pyx"]), ] cmdclass.update({'build_ext': build_ext}) -else: +elif use_c: # c files are there, compile to binaries ext_modules += [ Extension("pyspike.cython_add", ["pyspike/cython_add.c"]), Extension("pyspike.cython_distance", ["pyspike/cython_distance.c"]), ] +# neither cython nor c files available -> automatic fall-back to python backend setup( name='pyspike', @@ -41,6 +49,7 @@ setup( version='0.1.2', cmdclass=cmdclass, ext_modules=ext_modules, + include_dirs=[numpy.get_include()], description='A Python library for the numerical analysis of spike\ train similarity', author='Mario Mulansky', -- cgit v1.2.3