diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-08-10 10:42:54 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-08-10 10:42:54 +0200 |
commit | b79a49eaefe6feaad3a4a7cf48b4650488df1b36 (patch) | |
tree | 05b1233bcf0d01bc63537967264389ed28cc65e6 /dev-python/mpmath | |
parent | dev-libs/yyjson: Stabilize 0.10.0 arm64, #937690 (diff) | |
download | gentoo-b79a49eaefe6feaad3a4a7cf48b4650488df1b36.tar.gz gentoo-b79a49eaefe6feaad3a4a7cf48b4650488df1b36.tar.bz2 gentoo-b79a49eaefe6feaad3a4a7cf48b4650488df1b36.zip |
dev-python/mpmath: Deselect test failing on ppc64, sparc
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/mpmath')
-rw-r--r-- | dev-python/mpmath/files/mpmath-1.4.0_alpha1-numpy-2.patch | 32 | ||||
-rw-r--r-- | dev-python/mpmath/mpmath-1.4.0_alpha1.ebuild | 9 |
2 files changed, 4 insertions, 37 deletions
diff --git a/dev-python/mpmath/files/mpmath-1.4.0_alpha1-numpy-2.patch b/dev-python/mpmath/files/mpmath-1.4.0_alpha1-numpy-2.patch deleted file mode 100644 index 13b6ffc9a94f..000000000000 --- a/dev-python/mpmath/files/mpmath-1.4.0_alpha1-numpy-2.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b80b0e08b75f41730a1116aebe34361e5d63d58c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> -Date: Tue, 2 Jul 2024 08:11:58 +0200 -Subject: [PATCH] Fix the comparison in test_compatibility for NumPy 2.0.0 - -The comparison in `mpmath/tests/test_convert.py::test_compatibility` -failed for `np.float16` in NumPy 2.0.0 since `2.0**-53` cannot be -represented in half-precision floating point type. Convert the LHS -to `np.float64` to ensure that the comparison is done in sufficiently -precise type. - -This fixes the actual test failure from #815 but the deprecation warning -remains. ---- - mpmath/tests/test_convert.py | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/mpmath/tests/test_convert.py b/mpmath/tests/test_convert.py -index 5578b245..c6ef2187 100644 ---- a/mpmath/tests/test_convert.py -+++ b/mpmath/tests/test_convert.py -@@ -254,7 +254,9 @@ def test_compatibility(): - # Handle the weird types - try: diff = np.abs(type(np.sqrt(x))(sqrt(x)) - np.sqrt(x)) - except: continue -- assert diff < 2.0**-53 -+ # numpy-2 does the comparison on LHS type, so we need to convert -+ # it to a type that can actually represent 2.0**-53 -+ assert np.float64(diff) < 2.0**-53 - assert mpf(np.float64('inf')) == inf - assert isnan(mp.npconvert(np.float64('nan'))) - if hasattr(np, "float128"): diff --git a/dev-python/mpmath/mpmath-1.4.0_alpha1.ebuild b/dev-python/mpmath/mpmath-1.4.0_alpha1.ebuild index ef235883f25d..d1fb0d556ec1 100644 --- a/dev-python/mpmath/mpmath-1.4.0_alpha1.ebuild +++ b/dev-python/mpmath/mpmath-1.4.0_alpha1.ebuild @@ -38,11 +38,6 @@ BDEPEND=" EPYTEST_XDIST=1 distutils_enable_tests pytest -PATCHES=( - # https://github.com/mpmath/mpmath/pull/816 - "${FILESDIR}/${P}-numpy-2.patch" -) - python_test() { local EPYTEST_DESELECT=( # TODO @@ -51,6 +46,10 @@ python_test() { mpmath/tests/test_cli.py::test_bare_console_pretty mpmath/tests/test_cli.py::test_bare_console_without_ipython mpmath/tests/test_cli.py::test_bare_console_wrap_floats + # precision problems on some arches, also np2 + # https://github.com/mpmath/mpmath/pull/816 + # https://github.com/mpmath/mpmath/issues/836 + mpmath/tests/test_convert.py::test_compatibility ) local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 |