[Python-modules-commits] [pyfits] 01/02: Add patches/04-numpy-1.12.patch taken from astropy to fix the testsuite with numpy 1.12 (closes: #848779).

Aurelien Jarno aurel32 at moszumanska.debian.org
Mon Dec 19 23:47:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

aurel32 pushed a commit to branch master
in repository pyfits.

commit 11725934caf637225b5157cae10fe49688235d9a
Author: Aurelien Jarno <aurelien at aurel32.net>
Date:   Tue Dec 20 00:44:35 2016 +0100

    Add patches/04-numpy-1.12.patch taken from astropy to fix the testsuite with numpy 1.12 (closes: #848779).
---
 debian/changelog                   |  5 +++++
 debian/patches/04-numpy-1.12.patch | 25 +++++++++++++++++++++++++
 debian/patches/series              |  1 +
 3 files changed, 31 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index d1b4603..3313306 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,12 @@
 pyfits (1:3.4-4) UNRELEASED; urgency=medium
 
+  [ Ondřej Nový ]
   * Fixed VCS URL (https)
 
+  [ Aurelien Jarno ]
+  * Add patches/04-numpy-1.12.patch taken from astropy to fix the testsuite
+    with numpy 1.12 (closes: #848779).
+
  -- Ondřej Nový <novy at ondrej.org>  Tue, 29 Mar 2016 21:49:23 +0200
 
 pyfits (1:3.4-3) unstable; urgency=medium
diff --git a/debian/patches/04-numpy-1.12.patch b/debian/patches/04-numpy-1.12.patch
new file mode 100644
index 0000000..fbba251
--- /dev/null
+++ b/debian/patches/04-numpy-1.12.patch
@@ -0,0 +1,25 @@
+--- a/pyfits/tests/test_table.py
++++ b/pyfits/tests/test_table.py
+@@ -6,6 +6,7 @@ from warnings import catch_warnings
+ import contextlib
+ import copy
+ import gc
++import re
+ 
+ import numpy as np
+ from numpy import char as chararray
+@@ -863,9 +864,11 @@ class TestTableFunctions(PyfitsTestCase)
+ 
+         hdul = fits.open(self.temp('newtable.fits'))
+ 
+-        assert str(hdu.data) == "[('NGC1002', 12.3) ('NGC1003', 15.2)]"
+-
+-        assert str(hdul[1].data) == "[('NGC1002', 12.3) ('NGC1003', 15.2)]"
++        # numpy >= 1.12 changes how structured arrays are printed, so we
++        # match to a regex rather than a specific string.
++        expect = r"\[\('NGC1002',\s+12.3[0-9]*\) \(\'NGC1003\',\s+15.[0-9]+\)\]"
++        assert re.match(expect, str(hdu.data))
++        assert re.match(expect, str(hdul[1].data))
+ 
+         t.close()
+         hdul.close()
diff --git a/debian/patches/series b/debian/patches/series
index 7ff0b0a..38c91eb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 01-system-cfitsio.diff
 02-numpy-deprecation-warning.diff
 03-fix-for-cfitsio-3380.patch
+04-numpy-1.12.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pyfits.git



More information about the Python-modules-commits mailing list