diff options
author | Matthew Brett <matthew.brett@gmail.com> | 2015-09-21 10:22:25 -0700 |
---|---|---|
committer | Matthew Brett <matthew.brett@gmail.com> | 2015-09-21 10:22:25 -0700 |
commit | edb902cdc6573553afcf11047ecdfb447e444322 (patch) | |
tree | 652aa01ac7a621b2b95f3307aefca6890ca62fb7 | |
parent | 3a2f05582ecd87d8aa599e435330f459e6a4d3ea (diff) | |
parent | 7f96e9d7ab678b636761313e22d03e73bb929520 (diff) | |
download | numpy-edb902cdc6573553afcf11047ecdfb447e444322.tar.gz |
Merge pull request #6332 from matthew-brett/prepare-1.9.3v1.9.3
MRG: preparations for 1.9.3 release
Backport of 7d6aa8c - gzip fix for Python 3.5
Backport of b08f369 - numpy.distutils patch to help homebrew
Backport of various fixes for Windows builds on modern MSVC.
-rw-r--r-- | doc/release/1.9.3-notes.rst | 23 | ||||
-rw-r--r-- | numpy/core/include/numpy/npy_math.h | 4 | ||||
-rw-r--r-- | numpy/core/setup_common.py | 9 | ||||
-rw-r--r-- | numpy/core/src/private/npy_config.h | 26 | ||||
-rw-r--r-- | numpy/distutils/command/build_ext.py | 18 | ||||
-rw-r--r-- | numpy/distutils/fcompiler/intel.py | 2 | ||||
-rw-r--r-- | numpy/lib/npyio.py | 51 | ||||
-rw-r--r-- | pavement.py | 4 | ||||
-rwxr-xr-x | setup.py | 2 |
9 files changed, 80 insertions, 59 deletions
diff --git a/doc/release/1.9.3-notes.rst b/doc/release/1.9.3-notes.rst new file mode 100644 index 000000000..9abadec5f --- /dev/null +++ b/doc/release/1.9.3-notes.rst @@ -0,0 +1,23 @@ +NumPy 1.9.3 Release Notes +************************* + +This is a bugfix only release in the 1.9.x series. + +The only changes from 1.9.2 are a fix for reading gzipped text files on Python +3.5 and some build fixes. + +Issues fixed +============ + +* `#5866 <https://github.com/numpy/numpy/pull/5866>`__: fix error finding + Python headers when ``build_ext`` ``--include-dirs`` is set; +* `#6016 <https://github.com/numpy/numpy/pull/6016>`__: fix ``np.loadtxt`` + error on Python 3.5 when reading from gzip files; +* `#5555 <https://github.com/numpy/numpy/pull/5555>`__: Replace deprecated + options for ifort; +* `#6096 <https://github.com/numpy/numpy/pull/6096>`__: remove /GL for VS2015 + in check_long_double_representation; +* `#6141 <https://github.com/numpy/numpy/pull/6141>`__: enable Visual Studio + 2015 C99 features; +* `#6171 <https://github.com/numpy/numpy/pull/6171>`__: revert C99 complex for + MSVC14. diff --git a/numpy/core/include/numpy/npy_math.h b/numpy/core/include/numpy/npy_math.h index b7920460d..461651b08 100644 --- a/numpy/core/include/numpy/npy_math.h +++ b/numpy/core/include/numpy/npy_math.h @@ -164,7 +164,7 @@ double npy_spacing(double x); #ifndef NPY_HAVE_DECL_ISNAN #define npy_isnan(x) ((x) != (x)) #else - #ifdef _MSC_VER + #if defined(_MSC_VER) && (_MSC_VER < 1900) #define npy_isnan(x) _isnan((x)) #else #define npy_isnan(x) isnan(x) @@ -195,7 +195,7 @@ double npy_spacing(double x); #ifndef NPY_HAVE_DECL_ISINF #define npy_isinf(x) (!npy_isfinite(x) && !npy_isnan(x)) #else - #ifdef _MSC_VER + #if defined(_MSC_VER) && (_MSC_VER < 1900) #define npy_isinf(x) (!_finite((x)) && !_isnan((x))) #else #define npy_isinf(x) isinf((x)) diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py index be5673a47..81eec041b 100644 --- a/numpy/core/setup_common.py +++ b/numpy/core/setup_common.py @@ -171,6 +171,15 @@ def check_long_double_representation(cmd): cmd._check_compiler() body = LONG_DOUBLE_REPRESENTATION_SRC % {'type': 'long double'} + # Disable whole program optimization (the default on vs2015, with python 3.5+) + # which generates intermediary object files and prevents checking the + # float representation. + if sys.platform == "win32": + try: + cmd.compiler.compile_options.remove("/GL") + except ValueError: + pass + # We need to use _compile because we need the object filename src, object = cmd._compile(body, None, None, 'c') try: diff --git a/numpy/core/src/private/npy_config.h b/numpy/core/src/private/npy_config.h index f768c9097..70a4c0c1f 100644 --- a/numpy/core/src/private/npy_config.h +++ b/numpy/core/src/private/npy_config.h @@ -6,9 +6,33 @@ #include "numpy/npy_cpu.h" /* Disable broken MS math functions */ -#if defined(_MSC_VER) || defined(__MINGW32_VERSION) +#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__MINGW32_VERSION) + #undef HAVE_ATAN2 +#undef HAVE_ATAN2F +#undef HAVE_ATAN2L + #undef HAVE_HYPOT +#undef HAVE_HYPOTF +#undef HAVE_HYPOTL + +#endif + +#if defined(_MSC_VER) && (_MSC_VER == 1900) + +#undef HAVE_CASIN +#undef HAVE_CASINF +#undef HAVE_CASINL +#undef HAVE_CASINH +#undef HAVE_CASINHF +#undef HAVE_CASINHL +#undef HAVE_CATAN +#undef HAVE_CATANF +#undef HAVE_CATANL +#undef HAVE_CATANH +#undef HAVE_CATANHF +#undef HAVE_CATANHL + #endif /* diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py index b48e4227a..b75d19ec4 100644 --- a/numpy/distutils/command/build_ext.py +++ b/numpy/distutils/command/build_ext.py @@ -46,10 +46,22 @@ class build_ext (old_build_ext): self.fcompiler = None def finalize_options(self): - incl_dirs = self.include_dirs + # Ensure that self.include_dirs and self.distribution.include_dirs + # refer to the same list object. finalize_options will modify + # self.include_dirs, but self.distribution.include_dirs is used + # during the actual build. + # self.include_dirs is None unless paths are specified with + # --include-dirs. + # The include paths will be passed to the compiler in the order: + # numpy paths, --include-dirs paths, Python include path. + if isinstance(self.include_dirs, str): + self.include_dirs = self.include_dirs.split(os.pathsep) + incl_dirs = self.include_dirs or [] + if self.distribution.include_dirs is None: + self.distribution.include_dirs = [] + self.include_dirs = self.distribution.include_dirs + self.include_dirs.extend(incl_dirs) old_build_ext.finalize_options(self) - if incl_dirs is not None: - self.include_dirs.extend(self.distribution.include_dirs or []) def run(self): if not self.extensions: diff --git a/numpy/distutils/fcompiler/intel.py b/numpy/distutils/fcompiler/intel.py index a80e525e3..f76174c7a 100644 --- a/numpy/distutils/fcompiler/intel.py +++ b/numpy/distutils/fcompiler/intel.py @@ -152,7 +152,7 @@ class IntelVisualFCompiler(BaseIntelFCompiler): module_include_switch = '/I' def get_flags(self): - opt = ['/nologo', '/MD', '/nbs', '/Qlowercase', '/us'] + opt = ['/nologo', '/MD', '/nbs', '/names:lowercase', '/assume:underscore'] return opt def get_flags_free(self): diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index bc86cf5ea..d98d5a957 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -37,52 +37,6 @@ __all__ = [ ] -def seek_gzip_factory(f): - """Use this factory to produce the class so that we can do a lazy - import on gzip. - - """ - import gzip - - class GzipFile(gzip.GzipFile): - - def seek(self, offset, whence=0): - # figure out new position (we can only seek forwards) - if whence == 1: - offset = self.offset + offset - - if whence not in [0, 1]: - raise IOError("Illegal argument") - - if offset < self.offset: - # for negative seek, rewind and do positive seek - self.rewind() - count = offset - self.offset - for i in range(count // 1024): - self.read(1024) - self.read(count % 1024) - - def tell(self): - return self.offset - - if isinstance(f, str): - f = GzipFile(f) - elif isinstance(f, gzip.GzipFile): - # cast to our GzipFile if its already a gzip.GzipFile - - try: - name = f.name - except AttributeError: - # Backward compatibility for <= 2.5 - name = f.filename - mode = f.mode - - f = GzipFile(fileobj=f.fileobj, filename=name) - f.mode = mode - - return f - - class BagObj(object): """ BagObj(obj) @@ -368,8 +322,6 @@ def load(file, mmap_mode=None): if isinstance(file, basestring): fid = open(file, "rb") own_fid = True - elif isinstance(file, gzip.GzipFile): - fid = seek_gzip_factory(file) else: fid = file @@ -730,7 +682,8 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, if _is_string_like(fname): fown = True if fname.endswith('.gz'): - fh = iter(seek_gzip_factory(fname)) + import gzip + fh = iter(gzip.GzipFile(fname)) elif fname.endswith('.bz2'): import bz2 fh = iter(bz2.BZ2File(fname)) diff --git a/pavement.py b/pavement.py index e0c38f5df..43e882c96 100644 --- a/pavement.py +++ b/pavement.py @@ -99,10 +99,10 @@ finally: #----------------------------------- # Source of the release notes -RELEASE_NOTES = 'doc/release/1.9.2-notes.rst' +RELEASE_NOTES = 'doc/release/1.9.3-notes.rst' # Start/end of the log (from git) -LOG_START = 'v1.9.1' +LOG_START = 'v1.9.2' LOG_END = 'maintenance/1.9.x' @@ -49,7 +49,7 @@ Operating System :: MacOS MAJOR = 1 MINOR = 9 -MICRO = 2 +MICRO = 3 ISRELEASED = True VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) |