summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatoro Mahri <matoro_gentoo@matoro.tk>2023-11-06 13:25:31 -0500
committerSam James <sam@gentoo.org>2023-11-07 20:33:57 +0000
commit4371dc93a2cc3cc988f908a41780381ea087d7cc (patch)
tree1ace80292806f78f0da29e3f9cbb67c828a46495 /dev-python/numpy
parentdev-python/jupyter-core: add dev-python/pip test dep (diff)
downloadgentoo-4371dc93a2cc3cc988f908a41780381ea087d7cc.tar.gz
gentoo-4371dc93a2cc3cc988f908a41780381ea087d7cc.tar.bz2
gentoo-4371dc93a2cc3cc988f908a41780381ea087d7cc.zip
dev-python/numpy: fix alpha issues
One test that imports numpy from system namespace, disable this test unless the current version of numpy is already installed. One test that needs source code patch, submitted upstream. See: https://github.com/numpy/numpy/pull/25078 Bug: https://bugs.gentoo.org/909738 Signed-off-by: Matoro Mahri <matoro_gentoo@matoro.tk> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/numpy')
-rw-r--r--dev-python/numpy/files/numpy-1.26.1-alpha.patch25
-rw-r--r--dev-python/numpy/numpy-1.26.1.ebuild8
2 files changed, 33 insertions, 0 deletions
diff --git a/dev-python/numpy/files/numpy-1.26.1-alpha.patch b/dev-python/numpy/files/numpy-1.26.1-alpha.patch
new file mode 100644
index 000000000000..a0b2ca2eda91
--- /dev/null
+++ b/dev-python/numpy/files/numpy-1.26.1-alpha.patch
@@ -0,0 +1,25 @@
+https://bugs.gentoo.org/909738
+https://github.com/numpy/numpy/pull/25078
+
+commit 43aaf2093d8dfb3c1fea5d409ea4aa1d0f77816f
+Author: matoro <matoro@users.noreply.github.com>
+Date: Mon Nov 6 10:21:32 2023 -0500
+
+ BUG: alpha doesn't use REAL(10)
+
+ Same as e.g. loongarch per gh-24904. At this point seems like it should
+ be more of an exclude list than an include one...
+
+diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py
+index f352bbaa2..d17b052f9 100755
+--- a/numpy/f2py/crackfortran.py
++++ b/numpy/f2py/crackfortran.py
+@@ -2452,7 +2452,7 @@ def _selected_real_kind_func(p, r=0, radix=0):
+ if p < 16:
+ return 8
+ machine = platform.machine().lower()
+- if machine.startswith(('aarch64', 'arm64', 'loongarch', 'power', 'ppc', 'riscv', 's390x', 'sparc')):
++ if machine.startswith(('aarch64', 'alpha', 'arm64', 'loongarch', 'power', 'ppc', 'riscv', 's390x', 'sparc')):
+ if p <= 33:
+ return 16
+ else:
diff --git a/dev-python/numpy/numpy-1.26.1.ebuild b/dev-python/numpy/numpy-1.26.1.ebuild
index 955652eea0d8..03c05aeaa686 100644
--- a/dev-python/numpy/numpy-1.26.1.ebuild
+++ b/dev-python/numpy/numpy-1.26.1.ebuild
@@ -49,6 +49,7 @@ BDEPEND="
>=dev-python/pytz-2019.3[${PYTHON_USEDEP}]
)
"
+PATCHES=( "${FILESDIR}/${PN}-1.26.1-alpha.patch" )
EPYTEST_XDIST=1
distutils_enable_tests pytest
@@ -142,6 +143,13 @@ python_test() {
;;
esac
+ if ! has_version -b "~${CATEGORY}/${P}[${PYTHON_USEDEP}]" ; then
+ # depends on importing numpy.random from system namespace
+ EPYTEST_DESELECT+=(
+ 'random/tests/test_extending.py::test_cython'
+ )
+ fi
+
rm -rf numpy || die
epytest --pyargs numpy
}