diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/allocation_tracking/track_allocations.py | 2 | ||||
-rwxr-xr-x | tools/c_coverage/c_coverage_report.py | 2 | ||||
-rw-r--r-- | tools/commitstats.py | 2 | ||||
-rw-r--r-- | tools/osxbuild/build.py | 1 | ||||
-rw-r--r-- | tools/osxbuild/install_and_test.py | 5 | ||||
-rwxr-xr-x | tools/py3tool.py | 45 | ||||
-rw-r--r-- | tools/test-installed-numpy.py | 2 | ||||
-rw-r--r-- | tools/win32build/build.py | 12 | ||||
-rw-r--r-- | tools/win32build/doall.py | 2 | ||||
-rw-r--r-- | tools/win32build/misc/x86analysis.py | 3 | ||||
-rw-r--r-- | tools/win32build/prepare_bootstrap.py | 2 |
11 files changed, 26 insertions, 52 deletions
diff --git a/tools/allocation_tracking/track_allocations.py b/tools/allocation_tracking/track_allocations.py index b37e8cd04..ddd0ffea0 100644 --- a/tools/allocation_tracking/track_allocations.py +++ b/tools/allocation_tracking/track_allocations.py @@ -1,4 +1,4 @@ -from __future__ import division +from __future__ import division, absolute_import import numpy as np import inspect diff --git a/tools/c_coverage/c_coverage_report.py b/tools/c_coverage/c_coverage_report.py index e4522bd92..83fdd1998 100755 --- a/tools/c_coverage/c_coverage_report.py +++ b/tools/c_coverage/c_coverage_report.py @@ -4,7 +4,7 @@ A script to create C code-coverage reports based on the output of valgrind's callgrind tool. """ -from __future__ import division +from __future__ import division, absolute_import import optparse import os diff --git a/tools/commitstats.py b/tools/commitstats.py index d89c7a98e..73e995912 100644 --- a/tools/commitstats.py +++ b/tools/commitstats.py @@ -1,4 +1,4 @@ -from __future__ import division +from __future__ import division, absolute_import # Run svn log -l <some number> diff --git a/tools/osxbuild/build.py b/tools/osxbuild/build.py index ef6006fa1..7aa9312dd 100644 --- a/tools/osxbuild/build.py +++ b/tools/osxbuild/build.py @@ -10,6 +10,7 @@ built using sudo so file permissions are correct when installed on user system. Script will prompt for sudo pwd. """ +from __future__ import division import os import shutil diff --git a/tools/osxbuild/install_and_test.py b/tools/osxbuild/install_and_test.py index e9b34f5b0..651298b3f 100644 --- a/tools/osxbuild/install_and_test.py +++ b/tools/osxbuild/install_and_test.py @@ -1,5 +1,8 @@ #!/usr/bin/env python -"""Install the built package and run the tests.""" +"""Install the built package and run the tests. + +""" +from __future__ import division import os diff --git a/tools/py3tool.py b/tools/py3tool.py index ef175ebfd..656327450 100755 --- a/tools/py3tool.py +++ b/tools/py3tool.py @@ -18,7 +18,7 @@ When running py3tool again, only changed files are re-processed, which makes the test-bugfix cycle faster. """ -from __future__ import division +from __future__ import division, absolute_import from optparse import OptionParser import shutil @@ -37,10 +37,6 @@ TEMP = os.path.normpath(os.path.join(BASE, '_py3k')) SCRIPT_2TO3 = os.path.join(BASE, 'tools', '2to3.py') EXTRA_2TO3_FLAGS = { - '*/setup.py': '-x import', - 'numpy/core/code_generators/generate_umath.py': '-x import', - 'numpy/core/code_generators/generate_numpy_api.py': '-x import', - 'numpy/core/code_generators/generate_ufunc_api.py': '-x import', 'numpy/core/defchararray.py': '-x unicode', 'numpy/compat/py3k.py': '-x unicode', 'numpy/ma/timer_comparison.py': 'skip', @@ -80,7 +76,8 @@ FIXES_TO_SKIP = [ 'input', 'raw_input', 'xreadlines', - 'xrange' + 'xrange', + 'import' ] skip_fixes= [] @@ -172,38 +169,6 @@ except: # Run nosetests subprocess.call(['nosetests3', '-v', d], cwd=TEMP) -def custom_mangling(filename): - import_mangling = [ - os.path.join('core', '__init__.py'), - os.path.join('core', 'numeric.py'), - os.path.join('core', '_internal.py'), - os.path.join('core', 'arrayprint.py'), - os.path.join('core', 'fromnumeric.py'), - os.path.join('numpy', '__init__.py'), - os.path.join('lib', 'npyio.py'), - os.path.join('lib', 'function_base.py'), - os.path.join('fft', 'fftpack.py'), - os.path.join('random', '__init__.py'), - ] - - if any(filename.endswith(x) for x in import_mangling): - f = open(filename, 'r') - text = f.read() - f.close() - for mod in ['multiarray', 'scalarmath', 'umath', '_sort', - '_compiled_base', 'core', 'lib', 'testing', 'fft', - 'polynomial', 'random', 'ma', 'linalg', 'compat', - 'mtrand', '_dotblas', 'version']: - text = re.sub(r'^(\s*)import %s' % mod, - r'\1from . import %s' % mod, - text, flags=re.M) - text = re.sub(r'^(\s*)from %s import' % mod, - r'\1from .%s import' % mod, - text, flags=re.M) - text = text.replace('from matrixlib', 'from .matrixlib') - f = open(filename, 'w') - f.write(text) - f.close() def walk_sync(dir1, dir2, _seen=None): if _seen is None: @@ -313,10 +278,6 @@ def sync_2to3(src, dst, patchfile=None, clean=False): finally: sys.stdout = _old_stdout - for fn, dst_fn in to_convert: - # perform custom mangling - custom_mangling(dst_fn) - p.close() if __name__ == "__main__": diff --git a/tools/test-installed-numpy.py b/tools/test-installed-numpy.py index ac917b05f..d3c865139 100644 --- a/tools/test-installed-numpy.py +++ b/tools/test-installed-numpy.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from __future__ import division +from __future__ import division, absolute_import # A simple script to test the installed version of numpy by calling # 'numpy.test()'. Key features: diff --git a/tools/win32build/build.py b/tools/win32build/build.py index 4acb2e879..43d8a395d 100644 --- a/tools/win32build/build.py +++ b/tools/win32build/build.py @@ -1,11 +1,15 @@ """Python script to build windows binaries to be fed to the "superpack". The script is pretty dumb: it assumes python executables are installed the -standard way, and the location for blas/lapack/atlas is harcoded.""" +standard way, and the location for blas/lapack/atlas is harcoded. + +TODO: + - integrate the x86analysis script to check built binaries + - make the config configurable with a file + +""" +from __future__ import division -# TODO: -# - integrate the x86analysis script to check built binaries -# - make the config configurable with a file import sys import subprocess import os diff --git a/tools/win32build/doall.py b/tools/win32build/doall.py index eb07394ea..e9866122e 100644 --- a/tools/win32build/doall.py +++ b/tools/win32build/doall.py @@ -1,3 +1,5 @@ +from __future__ import division + import subprocess import os diff --git a/tools/win32build/misc/x86analysis.py b/tools/win32build/misc/x86analysis.py index bccf0171c..e5eb886b4 100644 --- a/tools/win32build/misc/x86analysis.py +++ b/tools/win32build/misc/x86analysis.py @@ -5,6 +5,7 @@ # checking the assembly for instructions specific to sse, etc... Obviously, # this won't work all the times (for example, if some instructions are used # only after proper detection of the running CPU, this will give false alarm). +from __future__ import division import sys import re @@ -57,7 +58,7 @@ SSE2_SET = ["addpd", "addsd", "andnpd", "andpd", "clflush", "cmppd", "cmpsd", "sqrtsd", "subpd", "subsd", "ucomisd", "unpckhpd", "unpcklpd", "xorpd"] SSE3_SET = [ "addsubpd", "addsubps", "haddpd", "haddps", "hsubpd", "hsubps", - "lddqu", "movddup", "movshdup", "movsldup", "fisttp"] + "lddqu", "movddup", "movshdup", "movsldup", "fisttp"] def get_vendor_string(): """Return the vendor string reading cpuinfo.""" diff --git a/tools/win32build/prepare_bootstrap.py b/tools/win32build/prepare_bootstrap.py index f1d8edbfb..d5822b83e 100644 --- a/tools/win32build/prepare_bootstrap.py +++ b/tools/win32build/prepare_bootstrap.py @@ -1,3 +1,5 @@ +from __future__ import division + import os import subprocess import shutil |