diff options
Diffstat (limited to 'dev-python/numpy')
-rw-r--r-- | dev-python/numpy/Manifest | 4 | ||||
-rw-r--r-- | dev-python/numpy/files/numpy-2.2.5-py314.patch | 298 | ||||
-rw-r--r-- | dev-python/numpy/numpy-2.2.5-r1.ebuild | 202 | ||||
-rw-r--r-- | dev-python/numpy/numpy-2.2.5.ebuild | 2 |
4 files changed, 504 insertions, 2 deletions
diff --git a/dev-python/numpy/Manifest b/dev-python/numpy/Manifest index e6c3c5c69a3f..bb44c1fe4e61 100644 --- a/dev-python/numpy/Manifest +++ b/dev-python/numpy/Manifest @@ -1,4 +1,5 @@ AUX numpy-2.0.2-setuptools-74.patch 1108 BLAKE2B caaf54f911a6a260d0311c017be13620bb8386df122f62886aeff127c468cc5d7fd9ab2a8b55e4cf15330624b605e1caa4585b840bda2a9dcf2bcee307ee59cb SHA512 ff1280c6e17d580e9b762c29073f81131f30ae07890925874646defb2df47cfbfb1127262097df8ec9b15bc2c7fb44dc807013eccabc377eda5c98a1aaad7fa3 +AUX numpy-2.2.5-py314.patch 11203 BLAKE2B 6bda4f24dd4cbe0d171a55b6e5b38f7dba4e8634116d145b91c660eca7fe1cdce15e3d53775e043ff4890da88af28b5d64f4b4f519bedd0b8387dd9562e92a3e SHA512 5e42dbdd046af458ec36117565e78777b49f38106a1c6356b215966964e29326b54ce76d251aad14afa1e2af32b22420bd6eba01ad3cc360f9ef83b4bf06314b DIST numpy-1.26.4.tar.gz 15786129 BLAKE2B ee759d3a857111bc494d5e989a7b005375d942b2a89cda69be4a3bd7c6cb195003fd2a8a0535f1858d8977ff688b0ec36360dcba9c3160206eedce5e28f191ef SHA512 f7121ab4099fa0686f9c095d456baa4a5869d651d7b7a06385f885f329cf08f11024b5df5e7b4ee705970062a8102ec4f709512eabbfd5c9fccce4ef83b9c208 DIST numpy-2.0.2.tar.gz 18902015 BLAKE2B 63f993e3429bff1dac1ff79fad23a36a2493fd2c8a825ef96b6b87d82b0e68393d2829c5ecd9065df345c8bfbb1f8f385077f154264f7d2810d311d1d6672bd7 SHA512 d769fd4f07e082fae1661c6856d6d726e189f6931f3028c6819f9806aa9dfd15ab2b49c48b94bfd925eb3f74fddb6f044c9ba93bbb785b5476440dd1cf0b4999 DIST numpy-2.1.3.tar.gz 20166090 BLAKE2B 746d343b17039d58738358168a613a2b85d6fb9cad1eeb367b851cd8d46fd42647990b47f0b4fb794ce5c4da2fa0a5d61e3ba42ea2f1945680f36cff31bb7b0d SHA512 59568acda3a77160908a23c354f0574970cb3daeea79ab535762a75a5f3a52a5cedd5754bb507cc238cf5948b37f0045523ed59c04cf6fc4a94ed22b9b77b8c1 @@ -12,5 +13,6 @@ EBUILD numpy-2.1.3.ebuild 6246 BLAKE2B 0d1a013f45e3d444df736b81f3869a174f3075200 EBUILD numpy-2.2.2.ebuild 5801 BLAKE2B 1a4468ca65ef26bd303ab4189ba13885465ef9da29284a4bb73bd16bda7fb131139d54cbef7f03838229badbb2ee618dfe63b7871fdf8e4201613af822344f29 SHA512 1b335d129435a337f01ac245c9252b14fe0cd18c44acce5d4ff6aefe69c3b56dadc5d0750a18e776c420e6af4ab23c1db446f1b954d8f776365826e4542eb69e EBUILD numpy-2.2.3.ebuild 6217 BLAKE2B 931cb7299bcf9983e971d907915a7e2f47a4e709672f9b0990802d1d6a7577365ba38a95814ae50cb420b52b8002d63285301c4d06c6bc4ada34903a382280cf SHA512 408efd60526526f17ef0f10b939f551081e782b3fc570c0ac7a915a624dd840f0f39e4ce135ff07e4d285848a1e1cf0d9a3c317cc64aad2d7194db7a1306e167 EBUILD numpy-2.2.4.ebuild 6215 BLAKE2B acf9cc746f62303054166e574faf87200b595050739d93da90619b03b3fdf6378328d84a013696c268e618a811931b0a1aeacb813a00a29ecaa0f7fcbe0f774b SHA512 603a6d8dbf9738686a9ff6141be66baf1e1549ffc91d4a388deeab559d929cb6f791a51606a80b4707e5fc40cc93d1cad9f2ab685b46abf250747ddf0611c80d -EBUILD numpy-2.2.5.ebuild 6217 BLAKE2B 6fb8b9a2deb6a3c592666a6fd7fd6182260aba532b62ec6a808cede7edf77f6ceaffef096dcd45081dad06c86fd28633f2069259da76ff7920d131332ded4dfb SHA512 9cbbedbec377b13f5e1289ceef827db2d814d28936f5c3b68e3b3b05d6153d56779f35c9f877dad0bc203ddbd1dbeb23b395fd923967943af7ca99bb394d89df +EBUILD numpy-2.2.5-r1.ebuild 6368 BLAKE2B 96f3659882f8dc1f9aeb886c629754434d5146d442830e987d11e04f497bae1bf755ebda5b88462bade48d4de6d7c8f569f6aa676ad88df9929856a1d1fff470 SHA512 afafe88193309669141a734a442e5112c7c426d2acbf3b2922d100a8b1b06241b71a619ec259b0e3d74465cb6b27655819093555c85cfbff803b277f016bc71e +EBUILD numpy-2.2.5.ebuild 6216 BLAKE2B 1376855a2a0aff6a00b38c8fb2969782c63dd9939aab18e0b8ff96ecdf4e43edb75ac515ae69ad5fee6e806d3998b0637a54f9790a3ac875347986a74cca5ef8 SHA512 f6adad01713f0ccbd4ba2b335d255ee14f05c4841b37e719f7701de3c9dcd191aaa400a7b8d1b52b4ca4a6e245ffe195d925986c7a0d1c82b8f0161b6429c50d MISC metadata.xml 932 BLAKE2B 7a4af31f613bab05ff542da48bf6ff1484d9df2459f559516e71329451dd739d3df0fead507c8033d94ab9ed516b68efe7f21819a8cd6ca303643d8c8bc34e86 SHA512 32cb8c1ab61521a02cbec38f6ea383f074e50d46aa3462ddcb85710f9d348e8e628cf2a5725e3cd921cc32f02885a1b5f02125639f0ec885384eeeff7f468a06 diff --git a/dev-python/numpy/files/numpy-2.2.5-py314.patch b/dev-python/numpy/files/numpy-2.2.5-py314.patch new file mode 100644 index 000000000000..bdb0762e733c --- /dev/null +++ b/dev-python/numpy/files/numpy-2.2.5-py314.patch @@ -0,0 +1,298 @@ +From 57084ae28ed14f3bba89ab51104dd5521b7edb64 Mon Sep 17 00:00:00 2001 +From: Nathan Goldbaum <nathan.goldbaum@gmail.com> +Date: Tue, 22 Apr 2025 15:31:14 -0600 +Subject: [PATCH] ENH: Support Python 3.14 (#28748) + +* MNT: use CPython internal APIs to hotfix temporary elision on 3.14 + +This is based on a diff from Sam Gross, see +https://github.com/numpy/numpy/issues/28681#issuecomment-2810661401 + +* TST: use refcount deltas in tests that hardcode refcounts + +* TST: one more refcount test change I don't understand + +* TST: fix ResourceWarning + +* CI: add 3.14 and 3.14t linux CI + +* CI: try with setup-python instead of setup-uv + +* CI: fix 3.14t-dev cython install + +* Update numpy/_core/src/multiarray/temp_elide.c + +Co-authored-by: Ross Barnowski <rossbar@caltech.edu> + +* CI: drop linux 3.13t smoke test + +* TST: move refcount check inside with block + +* MNT: guard against a possible future PyPy 3.14 + +--------- + +Co-authored-by: Ross Barnowski <rossbar@caltech.edu> + +MNT: add support for 3.14.0b1 +--- + numpy/_core/src/multiarray/temp_elide.c | 19 +++++++++-- + numpy/_core/tests/test_dlpack.py | 8 ++--- + numpy/_core/tests/test_dtype.py | 3 +- + numpy/_core/tests/test_indexing.py | 6 ++-- + numpy/_core/tests/test_item_selection.py | 8 +++-- + numpy/_core/tests/test_multiarray.py | 4 ++- + numpy/_core/tests/test_nditer.py | 7 ++-- + numpy/_core/tests/test_regression.py | 43 +++++++++++------------- + numpy/_core/tests/test_umath.py | 4 +-- + 9 files changed, 62 insertions(+), 40 deletions(-) + +diff --git a/numpy/_core/src/multiarray/temp_elide.c b/numpy/_core/src/multiarray/temp_elide.c +index 662a2fa52b..9236476c42 100644 +--- a/numpy/_core/src/multiarray/temp_elide.c ++++ b/numpy/_core/src/multiarray/temp_elide.c +@@ -109,6 +109,19 @@ find_addr(void * addresses[], npy_intp naddr, void * addr) + return 0; + } + ++static int ++check_unique_temporary(PyObject *lhs) ++{ ++#if PY_VERSION_HEX == 0x030E00A7 && !defined(PYPY_VERSION) ++#error "NumPy is broken on CPython 3.14.0a7, please update to a newer version" ++#elif PY_VERSION_HEX >= 0x030E00B1 && !defined(PYPY_VERSION) ++ // see https://github.com/python/cpython/issues/133164 ++ return PyUnstable_Object_IsUniqueReferencedTemporary(lhs); ++#else ++ return 1; ++#endif ++} ++ + static int + check_callers(int * cannot) + { +@@ -295,7 +308,8 @@ can_elide_temp(PyObject *olhs, PyObject *orhs, int *cannot) + !PyArray_CHKFLAGS(alhs, NPY_ARRAY_OWNDATA) || + !PyArray_ISWRITEABLE(alhs) || + PyArray_CHKFLAGS(alhs, NPY_ARRAY_WRITEBACKIFCOPY) || +- PyArray_NBYTES(alhs) < NPY_MIN_ELIDE_BYTES) { ++ PyArray_NBYTES(alhs) < NPY_MIN_ELIDE_BYTES || ++ !check_unique_temporary(olhs)) { + return 0; + } + if (PyArray_CheckExact(orhs) || +@@ -372,7 +386,8 @@ can_elide_temp_unary(PyArrayObject * m1) + !PyArray_ISNUMBER(m1) || + !PyArray_CHKFLAGS(m1, NPY_ARRAY_OWNDATA) || + !PyArray_ISWRITEABLE(m1) || +- PyArray_NBYTES(m1) < NPY_MIN_ELIDE_BYTES) { ++ PyArray_NBYTES(m1) < NPY_MIN_ELIDE_BYTES || ++ !check_unique_temporary((PyObject *)m1)) { + return 0; + } + if (check_callers(&cannot)) { +diff --git a/numpy/_core/tests/test_dlpack.py b/numpy/_core/tests/test_dlpack.py +index 41dd724295..d273bd798e 100644 +--- a/numpy/_core/tests/test_dlpack.py ++++ b/numpy/_core/tests/test_dlpack.py +@@ -22,9 +22,9 @@ class TestDLPack: + def test_dunder_dlpack_refcount(self, max_version): + x = np.arange(5) + y = x.__dlpack__(max_version=max_version) +- assert sys.getrefcount(x) == 3 ++ startcount = sys.getrefcount(x) + del y +- assert sys.getrefcount(x) == 2 ++ assert startcount - sys.getrefcount(x) == 1 + + def test_dunder_dlpack_stream(self): + x = np.arange(5) +@@ -58,9 +58,9 @@ def test_strides_not_multiple_of_itemsize(self): + def test_from_dlpack_refcount(self, arr): + arr = arr.copy() + y = np.from_dlpack(arr) +- assert sys.getrefcount(arr) == 3 ++ startcount = sys.getrefcount(arr) + del y +- assert sys.getrefcount(arr) == 2 ++ assert startcount - sys.getrefcount(arr) == 1 + + @pytest.mark.parametrize("dtype", [ + np.bool, +diff --git a/numpy/_core/tests/test_dtype.py b/numpy/_core/tests/test_dtype.py +index deeca5171c..759eefeb2a 100644 +--- a/numpy/_core/tests/test_dtype.py ++++ b/numpy/_core/tests/test_dtype.py +@@ -1901,9 +1901,10 @@ class mytype: + if HAS_REFCOUNT: + # Create an array and test that memory gets cleaned up (gh-25949) + o = object() ++ startcount = sys.getrefcount(o) + a = np.array([o], dtype=dt) + del a +- assert sys.getrefcount(o) == 2 ++ assert sys.getrefcount(o) == startcount + + def test_custom_structured_dtype_errors(self): + class mytype: +diff --git a/numpy/_core/tests/test_indexing.py b/numpy/_core/tests/test_indexing.py +index f393c401cd..bb757cdf7e 100644 +--- a/numpy/_core/tests/test_indexing.py ++++ b/numpy/_core/tests/test_indexing.py +@@ -1174,6 +1174,8 @@ def _compare_index_result(self, arr, index, mimic_get, no_copy): + """Compare mimicked result to indexing result. + """ + arr = arr.copy() ++ if HAS_REFCOUNT: ++ startcount = sys.getrefcount(arr) + indexed_arr = arr[index] + assert_array_equal(indexed_arr, mimic_get) + # Check if we got a view, unless its a 0-sized or 0-d array. +@@ -1184,9 +1186,9 @@ def _compare_index_result(self, arr, index, mimic_get, no_copy): + if HAS_REFCOUNT: + if no_copy: + # refcount increases by one: +- assert_equal(sys.getrefcount(arr), 3) ++ assert_equal(sys.getrefcount(arr), startcount + 1) + else: +- assert_equal(sys.getrefcount(arr), 2) ++ assert_equal(sys.getrefcount(arr), startcount) + + # Test non-broadcast setitem: + b = arr.copy() +diff --git a/numpy/_core/tests/test_item_selection.py b/numpy/_core/tests/test_item_selection.py +index 5660ef583e..839127ecdb 100644 +--- a/numpy/_core/tests/test_item_selection.py ++++ b/numpy/_core/tests/test_item_selection.py +@@ -50,19 +50,23 @@ def test_simple(self): + + def test_refcounting(self): + objects = [object() for i in range(10)] ++ if HAS_REFCOUNT: ++ orig_rcs = [sys.getrefcount(o) for o in objects] + for mode in ('raise', 'clip', 'wrap'): + a = np.array(objects) + b = np.array([2, 2, 4, 5, 3, 5]) + a.take(b, out=a[:6], mode=mode) + del a + if HAS_REFCOUNT: +- assert_(all(sys.getrefcount(o) == 3 for o in objects)) ++ assert_(all(sys.getrefcount(o) == rc + 1 ++ for o, rc in zip(objects, orig_rcs))) + # not contiguous, example: + a = np.array(objects * 2)[::2] + a.take(b, out=a[:6], mode=mode) + del a + if HAS_REFCOUNT: +- assert_(all(sys.getrefcount(o) == 3 for o in objects)) ++ assert_(all(sys.getrefcount(o) == rc + 1 ++ for o, rc in zip(objects, orig_rcs))) + + def test_unicode_mode(self): + d = np.arange(10) +diff --git a/numpy/_core/tests/test_multiarray.py b/numpy/_core/tests/test_multiarray.py +index 87508732d8..3f26578c85 100644 +--- a/numpy/_core/tests/test_multiarray.py ++++ b/numpy/_core/tests/test_multiarray.py +@@ -6779,10 +6779,12 @@ def test_dot_3args(self): + v = np.random.random_sample((16, 32)) + + r = np.empty((1024, 32)) ++ if HAS_REFCOUNT: ++ orig_refcount = sys.getrefcount(r) + for i in range(12): + dot(f, v, r) + if HAS_REFCOUNT: +- assert_equal(sys.getrefcount(r), 2) ++ assert_equal(sys.getrefcount(r), orig_refcount) + r2 = dot(f, v, out=None) + assert_array_equal(r2, r) + assert_(r is dot(f, v, out=r)) +diff --git a/numpy/_core/tests/test_nditer.py b/numpy/_core/tests/test_nditer.py +index b0d911f24f..d6a9e42ae3 100644 +--- a/numpy/_core/tests/test_nditer.py ++++ b/numpy/_core/tests/test_nditer.py +@@ -1126,9 +1126,10 @@ def test_iter_object_arrays_conversions(): + rc = sys.getrefcount(ob) + for x in i: + x[...] += 1 +- if HAS_REFCOUNT: +- assert_(sys.getrefcount(ob) == rc-1) +- assert_equal(a, np.arange(6)+98172489) ++ if HAS_REFCOUNT: ++ newrc = sys.getrefcount(ob) ++ assert_(newrc == rc - 1) ++ assert_equal(a, np.arange(6) + 98172489) + + def test_iter_common_dtype(): + # Check that the iterator finds a common data type correctly +diff --git a/numpy/_core/tests/test_regression.py b/numpy/_core/tests/test_regression.py +index 851ce324d7..eeb640659e 100644 +--- a/numpy/_core/tests/test_regression.py ++++ b/numpy/_core/tests/test_regression.py +@@ -1586,29 +1586,26 @@ def test_take_refcount(self): + def test_fromfile_tofile_seeks(self): + # On Python 3, tofile/fromfile used to get (#1610) the Python + # file handle out of sync +- f0 = tempfile.NamedTemporaryFile() +- f = f0.file +- f.write(np.arange(255, dtype='u1').tobytes()) +- +- f.seek(20) +- ret = np.fromfile(f, count=4, dtype='u1') +- assert_equal(ret, np.array([20, 21, 22, 23], dtype='u1')) +- assert_equal(f.tell(), 24) +- +- f.seek(40) +- np.array([1, 2, 3], dtype='u1').tofile(f) +- assert_equal(f.tell(), 43) +- +- f.seek(40) +- data = f.read(3) +- assert_equal(data, b"\x01\x02\x03") +- +- f.seek(80) +- f.read(4) +- data = np.fromfile(f, dtype='u1', count=4) +- assert_equal(data, np.array([84, 85, 86, 87], dtype='u1')) +- +- f.close() ++ with tempfile.NamedTemporaryFile() as f: ++ f.write(np.arange(255, dtype='u1').tobytes()) ++ ++ f.seek(20) ++ ret = np.fromfile(f, count=4, dtype='u1') ++ assert_equal(ret, np.array([20, 21, 22, 23], dtype='u1')) ++ assert_equal(f.tell(), 24) ++ ++ f.seek(40) ++ np.array([1, 2, 3], dtype='u1').tofile(f) ++ assert_equal(f.tell(), 43) ++ ++ f.seek(40) ++ data = f.read(3) ++ assert_equal(data, b"\x01\x02\x03") ++ ++ f.seek(80) ++ f.read(4) ++ data = np.fromfile(f, dtype='u1', count=4) ++ assert_equal(data, np.array([84, 85, 86, 87], dtype='u1')) + + def test_complex_scalar_warning(self): + for tp in [np.csingle, np.cdouble, np.clongdouble]: +diff --git a/numpy/_core/tests/test_umath.py b/numpy/_core/tests/test_umath.py +index 4d56c785d5..d432e33412 100644 +--- a/numpy/_core/tests/test_umath.py ++++ b/numpy/_core/tests/test_umath.py +@@ -269,9 +269,9 @@ class ArrSubclass(np.ndarray): + pass + + arr = np.arange(10).view(ArrSubclass) +- ++ orig_refcount = sys.getrefcount(arr) + arr *= 1 +- assert sys.getrefcount(arr) == 2 ++ assert sys.getrefcount(arr) == orig_refcount + + + class TestComparisons: diff --git a/dev-python/numpy/numpy-2.2.5-r1.ebuild b/dev-python/numpy/numpy-2.2.5-r1.ebuild new file mode 100644 index 000000000000..cee6d0e62cd6 --- /dev/null +++ b/dev-python/numpy/numpy-2.2.5-r1.ebuild @@ -0,0 +1,202 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=meson-python +PYTHON_COMPAT=( python3_{11..14} pypy3_11 ) +PYTHON_REQ_USE="threads(+)" +FORTRAN_NEEDED=lapack + +inherit distutils-r1 flag-o-matic fortran-2 pypi + +DESCRIPTION="Fast array and numerical python library" +HOMEPAGE=" + https://numpy.org/ + https://github.com/numpy/numpy/ + https://pypi.org/project/numpy/ +" + +LICENSE="BSD" +SLOT="0/2" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +# +lapack because the internal fallbacks are pretty slow. Building without blas +# is barely supported anyway, see bug #914358. +IUSE="big-endian +lapack" + +RDEPEND=" + lapack? ( + >=virtual/cblas-3.8 + >=virtual/lapack-3.8 + ) +" +BDEPEND=" + ${RDEPEND} + >=dev-build/meson-1.1.0 + >=dev-python/cython-3.0.6[${PYTHON_USEDEP}] + lapack? ( + virtual/pkgconfig + ) + test? ( + $(python_gen_cond_dep ' + >=dev-python/cffi-1.14.0[${PYTHON_USEDEP}] + ' 'python*') + dev-python/charset-normalizer[${PYTHON_USEDEP}] + >=dev-python/hypothesis-5.8.0[${PYTHON_USEDEP}] + dev-python/pytest-rerunfailures[${PYTHON_USEDEP}] + dev-python/pytest-timeout[${PYTHON_USEDEP}] + >=dev-python/pytz-2019.3[${PYTHON_USEDEP}] + ) +" + +QA_CONFIG_IMPL_DECL_SKIP=( + # https://bugs.gentoo.org/925367 + vrndq_f32 +) + +EPYTEST_XDIST=1 +distutils_enable_tests pytest + +python_prepare_all() { + local PATCHES=( + # https://github.com/numpy/numpy/pull/28748 + # https://github.com/numpy/numpy/pull/28928 + "${FILESDIR}/${PN}-2.2.5-py314.patch" + ) + + # bug #922457 + filter-lto + # https://github.com/numpy/numpy/issues/25004 + append-flags -fno-strict-aliasing + + distutils-r1_python_prepare_all +} + +python_configure_all() { + DISTUTILS_ARGS=( + -Dallow-noblas=$(usex !lapack true false) + -Dblas=$(usev lapack cblas) + -Dlapack=$(usev lapack lapack) + # TODO: cpu-* options + ) +} + +python_test() { + local EPYTEST_DESELECT=( + # Very disk-and-memory-hungry + numpy/lib/tests/test_io.py::TestSaveTxt::test_large_zip + numpy/lib/tests/test_io.py::TestSavezLoad::test_closing_fid + numpy/lib/tests/test_io.py::TestSavezLoad::test_closing_zipfile_after_load + + # Precision problems + numpy/_core/tests/test_umath_accuracy.py::TestAccuracy::test_validate_transcendentals + + # Runs the whole test suite recursively, that's just crazy + numpy/core/tests/test_mem_policy.py::test_new_policy + + numpy/typing/tests/test_typing.py + # Uses huge amount of memory + numpy/core/tests/test_mem_overlap.py + ) + + if [[ $(uname -m) == armv8l ]]; then + # Degenerate case of arm32 chroot on arm64, bug #774108 + EPYTEST_DESELECT+=( + numpy/_core/tests/test_cpu_features.py::Test_ARM_Features::test_features + ) + fi + + case ${ARCH} in + arm) + EPYTEST_DESELECT+=( + # TODO: warnings + numpy/_core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception + + # TODO + numpy/_core/tests/test_function_base.py::TestLinspace::test_denormal_numbers + numpy/f2py/tests/test_kind.py::TestKind::test_real + numpy/f2py/tests/test_kind.py::TestKind::test_quad_precision + + # require too much memory + 'numpy/_core/tests/test_multiarray.py::TestDot::test_huge_vectordot[complex128]' + 'numpy/_core/tests/test_multiarray.py::TestDot::test_huge_vectordot[float64]' + ) + ;; + hppa) + EPYTEST_DESELECT+=( + # https://bugs.gentoo.org/942689 + "numpy/_core/tests/test_dtype.py::TestBuiltin::test_dtype[int]" + "numpy/_core/tests/test_dtype.py::TestBuiltin::test_dtype[float]" + "numpy/_core/tests/test_dtype.py::TestBuiltin::test_dtype_bytes_str_equivalence[datetime64]" + "numpy/_core/tests/test_dtype.py::TestBuiltin::test_dtype_bytes_str_equivalence[timedelta64]" + "numpy/_core/tests/test_dtype.py::TestBuiltin::test_dtype_bytes_str_equivalence[<f]" + "numpy/_core/tests/test_dtype.py::TestPickling::test_pickle_dtype[dt28]" + numpy/f2py/tests/test_kind.py::TestKind::test_real + numpy/f2py/tests/test_kind.py::TestKind::test_quad_precision + numpy/tests/test_ctypeslib.py::TestAsArray::test_reference_cycles + numpy/tests/test_ctypeslib.py::TestAsArray::test_segmentation_fault + numpy/tests/test_ctypeslib.py::TestAsCtypesType::test_scalar + numpy/tests/test_ctypeslib.py::TestAsCtypesType::test_subarray + numpy/tests/test_ctypeslib.py::TestAsCtypesType::test_structure + numpy/tests/test_ctypeslib.py::TestAsCtypesType::test_structure_aligned + numpy/tests/test_ctypeslib.py::TestAsCtypesType::test_union + numpy/tests/test_ctypeslib.py::TestAsCtypesType::test_padded_union + ) + ;; + ppc|x86) + EPYTEST_DESELECT+=( + # require too much memory + 'numpy/_core/tests/test_multiarray.py::TestDot::test_huge_vectordot[complex128]' + 'numpy/_core/tests/test_multiarray.py::TestDot::test_huge_vectordot[float64]' + ) + ;; + esac + + if [[ ${CHOST} == powerpc64le-* ]]; then + EPYTEST_DESELECT+=( + # long double thingy + numpy/_core/tests/test_scalarprint.py::TestRealScalars::test_ppc64_ibm_double_double128 + ) + fi + + if use big-endian; then + EPYTEST_DESELECT+=( + # ppc64 and sparc + numpy/linalg/tests/test_linalg.py::TestDet::test_generalized_sq_cases + numpy/linalg/tests/test_linalg.py::TestDet::test_sq_cases + "numpy/f2py/tests/test_return_character.py::TestFReturnCharacter::test_all_f77[s1]" + "numpy/f2py/tests/test_return_character.py::TestFReturnCharacter::test_all_f77[t1]" + "numpy/f2py/tests/test_return_character.py::TestFReturnCharacter::test_all_f90[s1]" + "numpy/f2py/tests/test_return_character.py::TestFReturnCharacter::test_all_f90[t1]" + ) + fi + + if ! has_version -b "~${CATEGORY}/${P}[${PYTHON_USEDEP}]" ; then + # depends on importing numpy.random from system namespace + EPYTEST_DESELECT+=( + 'numpy/random/tests/test_extending.py::test_cython' + ) + fi + + if has_version ">=dev-python/setuptools-74[${PYTHON_USEDEP}]"; then + # msvccompiler removal + EPYTEST_DESELECT+=( + numpy/tests/test_public_api.py::test_all_modules_are_expected_2 + numpy/tests/test_public_api.py::test_api_importable + ) + EPYTEST_IGNORE+=( + numpy/distutils/tests/test_mingw32ccompiler.py + numpy/distutils/tests/test_system_info.py + ) + fi + + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + cd "${BUILD_DIR}/install$(python_get_sitedir)" || die + epytest -p rerunfailures --reruns=5 +} + +python_install_all() { + local DOCS=( LICENSE.txt README.md THANKS.txt ) + distutils-r1_python_install_all +} diff --git a/dev-python/numpy/numpy-2.2.5.ebuild b/dev-python/numpy/numpy-2.2.5.ebuild index 6385f53149f4..33c563a51d72 100644 --- a/dev-python/numpy/numpy-2.2.5.ebuild +++ b/dev-python/numpy/numpy-2.2.5.ebuild @@ -20,7 +20,7 @@ HOMEPAGE=" LICENSE="BSD" SLOT="0/2" -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86" # +lapack because the internal fallbacks are pretty slow. Building without blas # is barely supported anyway, see bug #914358. IUSE="big-endian +lapack" |