diff options
author | Dan Meliza <dan@meliza.org> | 2017-10-02 12:15:36 -0400 |
---|---|---|
committer | Dan Meliza <dan@meliza.org> | 2017-10-02 12:21:59 -0400 |
commit | 564f9ba9df3c6837b102f370ad32a65c233c209f (patch) | |
tree | f38950ed3cc0208608d38d16e5ab6c3b13e40fa0 | |
parent | 50b3d0bd1ceea236d8b4e95578cebf7c78a5035e (diff) |
defer numpy import to allow install_requires to do its job (fixes #24)
-rw-r--r-- | setup.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -12,7 +12,6 @@ Distributed under the BSD License from setuptools import setup, find_packages from distutils.extension import Extension import os.path -import numpy try: from Cython.Distutils import build_ext @@ -21,6 +20,14 @@ except ImportError: else: use_cython = True + +class numpy_include(object): + """Defers import of numpy until install_requires is through""" + def __str__(self): + import numpy + return numpy.get_include() + + if os.path.isfile("pyspike/cython/cython_add.c") and \ os.path.isfile("pyspike/cython/cython_profiles.c") and \ os.path.isfile("pyspike/cython/cython_distances.c"): @@ -58,7 +65,7 @@ setup( version='0.5.1', cmdclass=cmdclass, ext_modules=ext_modules, - include_dirs=[numpy.get_include()], + include_dirs=[numpy_include()], description='A Python library for the numerical analysis of spike\ train similarity', author='Mario Mulansky', |