summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2013-11-21 09:38:32 +0000
committerJustin Lecher <jlec@gentoo.org>2013-11-21 09:38:32 +0000
commita11da77096460670b1f618e7c4d7331f3792ef72 (patch)
treef1440a3093fdf29ee59a8319762b8fe9fa8d452b /dev-python/mpi4py
parentStable on arm, wrt bug #458184 (diff)
downloadgentoo-2-a11da77096460670b1f618e7c4d7331f3792ef72.tar.gz
gentoo-2-a11da77096460670b1f618e7c4d7331f3792ef72.tar.bz2
gentoo-2-a11da77096460670b1f618e7c4d7331f3792ef72.zip
dev-python/mpi4py: Backport test fix for py3.3, #487836
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)
Diffstat (limited to 'dev-python/mpi4py')
-rw-r--r--dev-python/mpi4py/ChangeLog6
-rw-r--r--dev-python/mpi4py/files/mpi4py-1.3.1-py3-test-backport-1.patch81
-rw-r--r--dev-python/mpi4py/mpi4py-1.3.1.ebuild11
3 files changed, 92 insertions, 6 deletions
diff --git a/dev-python/mpi4py/ChangeLog b/dev-python/mpi4py/ChangeLog
index 71639882abec..10385715d574 100644
--- a/dev-python/mpi4py/ChangeLog
+++ b/dev-python/mpi4py/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-python/mpi4py
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/mpi4py/ChangeLog,v 1.13 2013/11/09 10:54:07 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/mpi4py/ChangeLog,v 1.14 2013/11/21 09:38:32 jlec Exp $
+
+ 21 Nov 2013; Justin Lecher <jlec@gentoo.org> mpi4py-1.3.1.ebuild,
+ +files/mpi4py-1.3.1-py3-test-backport-1.patch:
+ Backport test fix for py3.3, #487836
*mpi4py-1.3.1 (09 Nov 2013)
diff --git a/dev-python/mpi4py/files/mpi4py-1.3.1-py3-test-backport-1.patch b/dev-python/mpi4py/files/mpi4py-1.3.1-py3-test-backport-1.patch
new file mode 100644
index 000000000000..f92639f5be5f
--- /dev/null
+++ b/dev-python/mpi4py/files/mpi4py-1.3.1-py3-test-backport-1.patch
@@ -0,0 +1,81 @@
+ test/test_win.py | 48 +++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 37 insertions(+), 11 deletions(-)
+
+diff --git a/test/test_win.py b/test/test_win.py
+index 6da5c1f..7127e56 100644
+--- a/test/test_win.py
++++ b/test/test_win.py
+@@ -1,6 +1,30 @@
+ import sys
+ from mpi4py import MPI
+ import mpiunittest as unittest
++try:
++ from sys import getrefcount
++except ImportError:
++ class getrefcount(object):
++ def __init__(self, arg):
++ pass
++ def __eq__(self, other):
++ return True
++ def __add__(self, other):
++ return self
++ def __sub__(self, other):
++ return self
++
++def memzero(m):
++ n = len(m)
++ if n == 0: return
++ try:
++ zero = '\0'.encode('ascii')
++ m[0] = zero
++ except TypeError:
++ zero = 0
++ m[0] = zero
++ for i in range(n):
++ m[i] = zero
+
+ class BaseTestWin(object):
+
+@@ -11,29 +35,31 @@ class BaseTestWin(object):
+ try:
+ self.mpi_memory = MPI.Alloc_mem(10)
+ self.memory = self.mpi_memory
+- try:
+- zero = bytearray([0])
+- except NameError:
+- zero = str('\0')
+- self.memory[:] = zero * len(self.memory)
++ memzero(self.memory)
+ except MPI.Exception:
+ from array import array
+ self.mpi_memory = None
+ self.memory = array('B',[0]*10)
+- refcnt = sys.getrefcount(self.memory)
++ refcnt = getrefcount(self.memory)
+ self.WIN = MPI.Win.Create(self.memory, 1, self.INFO, self.COMM)
+ if type(self.memory).__name__ == 'buffer':
+- self.assertEqual(sys.getrefcount(self.memory), refcnt+1)
++ self.assertEqual(getrefcount(self.memory), refcnt+1)
+ else:
+- self.assertEqual(sys.getrefcount(self.memory), refcnt)
++ if sys.version_info[:3] < (3, 3):
++ self.assertEqual(getrefcount(self.memory), refcnt)
++ else:
++ self.assertEqual(getrefcount(self.memory), refcnt+1)
+
+ def tearDown(self):
+- refcnt = sys.getrefcount(self.memory)
++ refcnt = getrefcount(self.memory)
+ self.WIN.Free()
+ if type(self.memory).__name__ == 'buffer':
+- self.assertEqual(sys.getrefcount(self.memory), refcnt-1)
++ self.assertEqual(getrefcount(self.memory), refcnt-1)
+ else:
+- self.assertEqual(sys.getrefcount(self.memory), refcnt)
++ if sys.version_info[:3] < (3, 3):
++ self.assertEqual(getrefcount(self.memory), refcnt)
++ else:
++ self.assertEqual(getrefcount(self.memory), refcnt-1)
+ if self.mpi_memory:
+ MPI.Free_mem(self.mpi_memory)
+
diff --git a/dev-python/mpi4py/mpi4py-1.3.1.ebuild b/dev-python/mpi4py/mpi4py-1.3.1.ebuild
index 02c741d067f3..bd5614dfea0f 100644
--- a/dev-python/mpi4py/mpi4py-1.3.1.ebuild
+++ b/dev-python/mpi4py/mpi4py-1.3.1.ebuild
@@ -1,11 +1,10 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/mpi4py/mpi4py-1.3.1.ebuild,v 1.1 2013/11/09 10:54:07 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/mpi4py/mpi4py-1.3.1.ebuild,v 1.2 2013/11/21 09:38:32 jlec Exp $
EAPI=5
-# Still fails test with py3.3
-# https://bitbucket.org/mpi4py/mpi4py/issue/2/fails-test-with-py33
-PYTHON_COMPAT=( python{2_6,2_7,3_2} )
+
+PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
inherit distutils-r1
@@ -24,6 +23,8 @@ DEPEND="${RDEPEND}
virtual/mpi[romio] )"
DISTUTILS_IN_SOURCE_BUILD=1
+PATCHES=( "${FILESDIR}"/${P}-py3-test-backport-1.patch )
+
python_prepare_all() {
# not needed on install
rm -r docs/source || die
@@ -38,7 +39,7 @@ src_compile() {
python_test() {
echo "Beginning test phase"
pushd "${BUILD_DIR}"/../ &> /dev/null
- mpiexec -n 2 "${PYTHON}" ./test/runtests.py || die "Testsuite failed under ${EPYTHON}"
+ mpiexec -n 2 "${PYTHON}" ./test/runtests.py -v || die "Testsuite failed under ${EPYTHON}"
popd &> /dev/null
}