mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-python/h5py: Fix skipping inconvenient types on x86
Closes: https://bugs.gentoo.org/782238 Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
55
dev-python/h5py/files/h5py-3.2.1-i686-types.patch
Normal file
55
dev-python/h5py/files/h5py-3.2.1-i686-types.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
From 76c9c8c4049943c490556fa888cf7743d1a677e5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Mon, 12 Apr 2021 11:48:16 +0200
|
||||
Subject: [PATCH] TST: Skip problematic datatypes based on their length
|
||||
|
||||
Filter datatypes for tests based on their length rather than keeping
|
||||
a list of illegal platform+type combinations. This is more robust
|
||||
than the previous solution and fixes the test failures with new numpy
|
||||
versions (1.19.5 is the oldest I have tested) that declare 'float96'
|
||||
and 'complex192' on i686 rather than 'float128' and 'complex256'.
|
||||
|
||||
This fixes the following test failure:
|
||||
|
||||
E AttributeError: module 'numpy' has no attribute 'float128'
|
||||
|
||||
plus, later on (again):
|
||||
|
||||
E TypeError: Illegal length 24 for complex dtype
|
||||
---
|
||||
h5py/tests/test_dtype.py | 12 +++---------
|
||||
1 file changed, 3 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/h5py/tests/test_dtype.py b/h5py/tests/test_dtype.py
|
||||
index c5fac97e..ec4eda21 100644
|
||||
--- a/h5py/tests/test_dtype.py
|
||||
+++ b/h5py/tests/test_dtype.py
|
||||
@@ -13,8 +13,6 @@ except ImportError:
|
||||
|
||||
from .common import ut, TestCase
|
||||
|
||||
-UNSUPPORTED_LONG_DOUBLE = ('i386', 'i486', 'i586', 'i686', 'ppc64le')
|
||||
-
|
||||
|
||||
class TestVlen(TestCase):
|
||||
|
||||
@@ -289,13 +287,9 @@ class TestOffsets(TestCase):
|
||||
if (np.issubdtype(f, np.floating) or
|
||||
np.issubdtype(f, np.complexfloating)))
|
||||
|
||||
- if platform.machine() in UNSUPPORTED_LONG_DOUBLE:
|
||||
- dtype_dset_map = {str(j): d
|
||||
- for j, d in enumerate(dtypes)
|
||||
- if d not in (np.float128, np.complex256)}
|
||||
- else:
|
||||
- dtype_dset_map = {str(j): d
|
||||
- for j, d in enumerate(dtypes)}
|
||||
+ dtype_dset_map = {str(j): d
|
||||
+ for j, d in enumerate(dtypes)
|
||||
+ if d().nbytes in [4, 8, 16, 32]}
|
||||
|
||||
fname = self.mktemp()
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@@ -45,6 +45,10 @@ distutils_enable_sphinx docs \
|
||||
# use mpi && export CC=mpicc
|
||||
#}
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/h5py-3.2.1-i686-types.patch
|
||||
)
|
||||
|
||||
python_prepare_all() {
|
||||
# avoid pytest-mpi dep, we do not use mpi anyway
|
||||
sed -i -e 's:pytest-mpi::' pytest.ini || die
|
||||
|
||||
Reference in New Issue
Block a user