From 7ff5a4afe2d7a40dce34ae187a23b7d0feba33ba Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Thu, 16 Oct 2014 15:26:58 +0200 Subject: catch ImportError in setup.py --- .travis.yml | 1 - setup.py | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2bbb9ca..1035775 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,3 @@ install: script: - python setup.py build_ext --inplace - nosetests - diff --git a/setup.py b/setup.py index a9f40bd..fc8d0d2 100644 --- a/setup.py +++ b/setup.py @@ -2,16 +2,23 @@ Handles the compilation of pyx source files +run as: +python setup.py build_ext --inplace + Copyright 2014, Mario Mulansky Distributed under the BSD License """ from distutils.core import setup -from Cython.Build import cythonize import numpy -setup( - ext_modules=cythonize("pyspike/*.pyx"), - include_dirs=[numpy.get_include()] -) +try: + from Cython.Build import cythonize + setup( + ext_modules=cythonize("pyspike/*.pyx"), + include_dirs=[numpy.get_include()] + ) +except ImportError: + print("Error: Cython is not installed! You will only be able to use the \ +much slower Python backend in PySpike.") -- cgit v1.2.3