From ecd4b5f0f7e93859c1262593e2c09e1eb6775819 Mon Sep 17 00:00:00 2001 From: Dan Meliza Date: Mon, 2 Oct 2017 12:15:36 -0400 Subject: defer numpy import to allow install_requires to do its job (fixes #24) --- Changelog | 6 ++++++ setup.py | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 2be5e52..21b7cb0 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,9 @@ +PySpike v0.5: + * First beta release + * Python 2.6 support removed + * Python 3.6 support added + * several bugfixes + PySpike v0.4: * Python 3 support (thanks to Igor Gnatenko) * list interface to SpikeTrain class diff --git a/setup.py b/setup.py index f2315f2..afcfa16 100644 --- a/setup.py +++ b/setup.py @@ -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.2', 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', -- cgit v1.2.3