diff options
author | David Cournapeau <cournape@gmail.com> | 2009-09-09 00:40:43 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-09-09 00:40:43 +0000 |
commit | 0dc662a910c8c012bb5ec1740527e3ec4c31bbf6 (patch) | |
tree | 75274d48fb698b3c7e031c3b1d835c01c46d030a /numpy/distutils/command/scons.py | |
parent | bca568940c878b7739af43c3a96e59c6490970a1 (diff) | |
download | numpy-0dc662a910c8c012bb5ec1740527e3ec4c31bbf6.tar.gz |
Remove infunc imports.
Diffstat (limited to 'numpy/distutils/command/scons.py')
-rw-r--r-- | numpy/distutils/command/scons.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/numpy/distutils/command/scons.py b/numpy/distutils/command/scons.py index c363eb457..c52a452f6 100644 --- a/numpy/distutils/command/scons.py +++ b/numpy/distutils/command/scons.py @@ -1,4 +1,5 @@ import os +import sys import os.path from os.path import join as pjoin, dirname as pdirname @@ -11,7 +12,13 @@ from numpy.distutils.fcompiler import FCompiler, new_fcompiler from numpy.distutils.exec_command import find_executable from numpy.distutils import log from numpy.distutils.misc_util import is_bootstrapping, get_cmd +from numpy.distutils.misc_util import get_numpy_include_dirs as _incdir +# A few notes: +# - numscons is not mandatory to build numpy, so we cannot import it here. +# Any numscons import has to happen once we check numscons is available and +# is required for the build (call through setupscons.py or native numscons +# build). def get_scons_build_dir(): """Return the top path where everything produced by scons will be put. @@ -82,14 +89,12 @@ def get_python_exec_invoc(): # than the caller ? This may not be necessary, since os.system is said to # take into accound os.environ. This actually also works for my way of # using "local python", using the alias facility of bash. - import sys return sys.executable def get_numpy_include_dirs(sconscript_path): """Return include dirs for numpy. The paths are relatively to the setup.py script path.""" - from numpy.distutils.misc_util import get_numpy_include_dirs as _incdir from numscons import get_scons_build_dir scdir = pjoin(get_scons_build_dir(), pdirname(sconscript_path)) n = scdir.count(os.sep) @@ -269,9 +274,11 @@ def check_numscons(minver=(0, 10, 2)): if isinstance(version_info[0], str): raise ValueError("Numscons %s or above expected " \ "(detected 0.10.0)" % str(minver)) + # Stupid me used list instead of tuple in numscons + version_info = tuple(version_info) if version_info[:3] < minver: raise ValueError("Numscons %s or above expected (got %s) " - % (str(minver), str(version_info))) + % (str(minver), str(version_info[:3]))) except ImportError: raise RuntimeError("You need numscons >= %s to build numpy "\ "with numscons (imported numscons path " \ |