diff options
Diffstat (limited to 'dev-python/numpy')
-rw-r--r-- | dev-python/numpy/Manifest | 2 | ||||
-rw-r--r-- | dev-python/numpy/files/numpy-1.25.1-fix-scalartypes.patch | 36 | ||||
-rw-r--r-- | dev-python/numpy/numpy-1.25.1-r2.ebuild | 159 |
3 files changed, 197 insertions, 0 deletions
diff --git a/dev-python/numpy/Manifest b/dev-python/numpy/Manifest index 185b17ae59d9..d0e2195c3095 100644 --- a/dev-python/numpy/Manifest +++ b/dev-python/numpy/Manifest @@ -3,6 +3,7 @@ AUX numpy-1.24.3-fix-c++-linkage.patch 993 BLAKE2B 9ad31b995b209ea0674ee144a72df AUX numpy-1.25.0-fix-long-double-check.patch 5788 BLAKE2B c004fa342349a22dda30566d3015257146cee89e5b15c32d9b0bdbd44f4c7be76749f248e792d9ffd77ea8a674a2dfe0d183a9de48a1bb0f450e7a3f2f9688b0 SHA512 d2ecea4bc1878cb3df1b730b705bfa445f8f74356a5232de7ef5c94624847703985ac51d6b5bc3b961be6ef4b854804a531b5645e57ae4f6197d5aedb2e1c459 AUX numpy-1.25.0-skip-python3.12-irrelevant-tests.patch 7363 BLAKE2B ca4581f61fb1350803915bcc8e3198bd13c75e0c7e178c86e72682222cbafff396f23afad9d7427d9d2a4be625f84626c899493045a0b8cc7ee3d031d36712c3 SHA512 cce36c856beb2254436f2753ed94b7a933d1e4c06fe0a96c2be70d944f91bb13f3358f50981398d0b9169c0e01b64695c3adb797db15cb6b695488318e276886 AUX numpy-1.25.0_rc1-meson-pyproject.toml.patch 16917 BLAKE2B 6cdda647c1c4f003adcaff3d634cbaa2f6c1624f2e44bfff1b6542189693a1dc99bf8a3da38d5e9a5dd2b3a6382d0430f03eb3c39811cf3b72e85a1bbae9ea0e SHA512 0a51b1c84356704f373ba1188dc63152e45fdb7bc71881e8ab08b67bfbf2e8f1e9b5544eedf6e3d8b4b872e294e28233e9f059dfdad42ff835bba22ee66d0d93 +AUX numpy-1.25.1-fix-scalartypes.patch 1331 BLAKE2B a334980075c281d998ba7ce5223185254d2e07add4f180ad56c8567867f0cf65539992e989f4f31cec66f5739d28c3f45d10b94291fe40fd4e8dfb6c3bf92cb0 SHA512 326f38300d5873005f22660891981c61d94b6774ffd6d0712a1dbd2fa937394b691838957c0ffcedaac36b3491f6dc094acf1501ab1baceb33797cb9087af41b AUX replace_cpuflags.awk 405 BLAKE2B 1ac5f362a174793274a2e63fad73a7cf260b1fb139c479279c8cad7f400a376712b17312ee41defb785a7a2c84ec8e679aae48b41e88394a816f12f1cd366e56 SHA512 cce2253e00e2e56f3038782ff989703a9ef3d5f97d1b1f2570f6e23396d7abb7cff7f34588b67ec6c395cb192d7e3bfa6a8262ddf45193a2d0c91c2063efcf6d DIST numpy-1.24.0.tar.gz 10897101 BLAKE2B 59e2b913f90de76589d8fbb2f07e2d389012c7f6ce9bd641bc4837776465ce9c41c34f19f92bee55d4bae6245c1d2c84315b359ef0b089fd68d31cd7e7ec44b1 SHA512 3b4e6255b8d39e8504a50ecd3c2ba09d5b16d3f6c70b23b67e4dbf03d1fe390c55030f46090341d39a1ee8228c61ad6212fdc6e4579fcec9e26b4dbe70268661 DIST numpy-1.24.2.tar.gz 10906862 BLAKE2B e48f65eab709f0c57ec378d813a7b65bcaca6d5960b559d6db1c60726e5cf12517f4b2e1636b0ff815a2109925edccba200270db5170fd0aff5fd635919165ac SHA512 145fd7fb3919a185f75076d51b92c54a7fb1b776b637752ca15fdee15b239d6a517ef1bb8cded7c92e059cf6cda0146c24943c042d19b791e81125bc0ad4b820 @@ -18,4 +19,5 @@ EBUILD numpy-1.24.4-r1.ebuild 5156 BLAKE2B 25bec383fd68bee81b0652f5f1845b2e598db EBUILD numpy-1.24.4.ebuild 4628 BLAKE2B f6562a9a62262c0b78105ae9033537c65ee06ba79df7fb8e7ad6ecde01c7393dfc5e13234446e1642aaa3b05b1c8e9af4c7b6854a3c3a5f85931b259fb82d574 SHA512 ace98f02994fd18fb67e2879c2bcbe6fba39ed16cc3ee43acb75f50755175b4c6dfe6d72a21eb28a86e5ec2638f07ba6506d38a89b4b3155c41ba1827459f951 EBUILD numpy-1.25.0-r2.ebuild 3970 BLAKE2B 1c389a3487d90170531396cdd2c84891280724d33771e5c7e49c5eeb15bae338d1becc232f76d7183a880b633a0da6119b301e320a6f37f9a8adf5376c20115c SHA512 f3a6ec2f32237913c0ed18d829b6495dfc609824a4c89b436b67b3d4313d8fc10510f25b44741e265340dc447e696fed8d2339158c84b81259bd22a79f7240f6 EBUILD numpy-1.25.1-r1.ebuild 3881 BLAKE2B 1a8dbc928512866f17f842c7f97e0d39a6f2f7c7dfd11e9abd4f8a51cdcca76dcf1f0ef3233a4d658244699fe191a92bf742ff228415e48ff99b9510654bfe40 SHA512 7635c1c60fc873eb2c01194be9ae664bf20c82b254032716c91b1f30392279a5cf5b5585eefa68de8e8697a98277eb69b58fdf7525de5734057c18af3593d430 +EBUILD numpy-1.25.1-r2.ebuild 4444 BLAKE2B bc98460d27c6acd233ed219af855f93da93e6dd43db721195fd7e318256509145907136a1336f5d21c7252d05330eaf6b8f83f3f2bd4e4915d92ff447c57b564 SHA512 8dd4d5a3367d1260aa242558048d02da616695aa54f4b666b494d24aac7bef306bf7467fb73e6a7138f67086af51d3d191830a47c14b73062bf0836c345f4397 MISC metadata.xml 932 BLAKE2B 7a4af31f613bab05ff542da48bf6ff1484d9df2459f559516e71329451dd739d3df0fead507c8033d94ab9ed516b68efe7f21819a8cd6ca303643d8c8bc34e86 SHA512 32cb8c1ab61521a02cbec38f6ea383f074e50d46aa3462ddcb85710f9d348e8e628cf2a5725e3cd921cc32f02885a1b5f02125639f0ec885384eeeff7f468a06 diff --git a/dev-python/numpy/files/numpy-1.25.1-fix-scalartypes.patch b/dev-python/numpy/files/numpy-1.25.1-fix-scalartypes.patch new file mode 100644 index 000000000000..845b41fef23a --- /dev/null +++ b/dev-python/numpy/files/numpy-1.25.1-fix-scalartypes.patch @@ -0,0 +1,36 @@ +https://bugs.gentoo.org/910739 +https://github.com/numpy/numpy/issues/24239 +https://github.com/numpy/numpy/pull/24240 + +From f5eb12cafc99bb33dad6535dacab2f592aafb2b0 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Sun, 23 Jul 2023 21:31:08 +0100 +Subject: [PATCH] BUG: Fix C types in scalartypes + +https://github.com/numpy/numpy/pull/23746 introduced a fast path for scalar +int conversions, but the map between Python types and C types was subtly +wrong. + +This fixes tests on at least ppc32 (big-endian). + +Many thanks to Sebastian Berg for debugging this with me and pointing out +what needed to be fixed. + +Closes #24239. + +Fixes: 81caed6e3c34c4bf4b22b4f6167e816ba2a3f73c +--- a/numpy/core/src/multiarray/scalartypes.c.src ++++ b/numpy/core/src/multiarray/scalartypes.c.src +@@ -301,10 +301,10 @@ genint_type_str(PyObject *self) + item = PyLong_FromUnsignedLong(*(uint32_t *)val); + break; + case NPY_LONG: +- item = PyLong_FromLong(*(int64_t *)val); ++ item = PyLong_FromLong(*(long *)val); + break; + case NPY_ULONG: +- item = PyLong_FromUnsignedLong(*(uint64_t *)val); ++ item = PyLong_FromUnsignedLong(*(unsigned long *)val); + break; + case NPY_LONGLONG: + item = PyLong_FromLongLong(*(long long *)val); diff --git a/dev-python/numpy/numpy-1.25.1-r2.ebuild b/dev-python/numpy/numpy-1.25.1-r2.ebuild new file mode 100644 index 000000000000..1b46bf5e470b --- /dev/null +++ b/dev-python/numpy/numpy-1.25.1-r2.ebuild @@ -0,0 +1,159 @@ +# Copyright 1999-2023 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_{10..12} pypy3 ) +PYTHON_REQ_USE="threads(+)" +FORTRAN_NEEDED=lapack + +inherit distutils-r1 flag-o-matic fortran-2 multiprocessing pypi toolchain-funcs + +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" +IUSE="lapack" +if [[ ${PV} != *_rc* ]] ; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +fi + +RDEPEND=" + lapack? ( + >=virtual/cblas-3.8 + >=virtual/lapack-3.8 + ) +" +BDEPEND=" + ${RDEPEND} + >=dev-util/meson-1.1.0 + >=dev-python/cython-0.29.30[${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-xdist[${PYTHON_USEDEP}] + >=dev-python/pytz-2019.3[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-1.25.0_rc1-meson-pyproject.toml.patch + "${FILESDIR}"/${PN}-1.25.0-skip-python3.12-irrelevant-tests.patch + "${FILESDIR}"/${PN}-1.25.1-fix-scalartypes.patch +) + +distutils_enable_tests pytest + +python_prepare_all() { + append-flags -fno-strict-aliasing + + distutils-r1_python_prepare_all + + # TODO: Please drop once 1.25.0_rc1-meson-pyproject.toml.patch is gone + sed -i -e "s:version = \"2.0.0.dev0\":version = \"${PV}\":" pyproject.toml || die +} + +python_configure_all() { + DISTUTILS_ARGS=( + -Dblas=$(usev lapack cblas) + -Dlapack=$(usev lapack lapack) + ) +} + +python_test() { + local EPYTEST_DESELECT=( + # very disk-and-memory-hungry + lib/tests/test_io.py::test_large_zip + + # precision problems + core/tests/test_umath_accuracy.py::TestAccuracy::test_validate_transcendentals + + # runs the whole test suite recursively, that's just crazy + core/tests/test_mem_policy.py::test_new_policy + + # XXX: I've no idea why this ends up being needed in deselect and not ignore + typing/tests/test_typing.py + ) + + if [[ ${EPYTHON} == pypy3 ]]; then + EPYTEST_DESELECT+=( + # TODO: crashed + lib/tests/test_histograms.py::TestHistogram::test_big_arrays + ) + fi + + if use arm && [[ $(uname -m || echo "unknown") == "armv8l" ]] ; then + # Degenerate case of arm32 chroot on arm64, bug #774108 + EPYTEST_DESELECT+=( + core/tests/test_cpu_features.py::Test_ARM_Features::test_features + ) + fi + + if use x86 ; then + EPYTEST_DESELECT+=( + # https://github.com/numpy/numpy/issues/18388 + core/tests/test_umath.py::TestRemainder::test_float_remainder_overflow + # https://github.com/numpy/numpy/issues/18387 + random/tests/test_generator_mt19937.py::TestRandomDist::test_pareto + # more precision problems + core/tests/test_einsum.py::TestEinsum::test_einsum_sums_int16 + ) + fi + + if use hppa ; then + EPYTEST_DESELECT+=( + # TODO: Get selectedrealkind updated! + # bug #907228 + # https://github.com/numpy/numpy/issues/3424 (https://github.com/numpy/numpy/issues/3424#issuecomment-412369029) + # https://github.com/numpy/numpy/pull/21785 + f2py/tests/test_kind.py::TestKind::test_real + f2py/tests/test_kind.py::TestKind::test_quad_precision + ) + fi + + if [[ $(tc-endian) == "big" ]] ; then + # https://github.com/numpy/numpy/issues/11831 and bug #707116 + EPYTEST_DESELECT+=( + 'f2py/tests/test_return_character.py::TestFReturnCharacter::test_all_f77[s1]' + 'f2py/tests/test_return_character.py::TestFReturnCharacter::test_all_f90[t1]' + 'f2py/tests/test_return_character.py::TestFReturnCharacter::test_all_f90[s1]' + 'f2py/tests/test_return_character.py::TestFReturnCharacter::test_all_f77[t1]' + f2py/tests/test_kind.py::TestKind::test_int + ) + fi + + case "${ABI}" in + alpha|arm|hppa|m68k|o32|ppc|s390|sh|sparc|x86) + EPYTEST_DESELECT+=( + # too large for 32-bit platforms + core/tests/test_ufunc.py::TestUfunc::test_identityless_reduction_huge_array + 'core/tests/test_multiarray.py::TestDot::test_huge_vectordot[float64]' + 'core/tests/test_multiarray.py::TestDot::test_huge_vectordot[complex128]' + lib/tests/test_histograms.py::TestHistogram::test_big_arrays + ) + ;; + *) + ;; + esac + + rm -rf numpy || die + epytest -n "$(makeopts_jobs)" --pyargs numpy +} + +python_install_all() { + local DOCS=( LICENSE.txt README.md THANKS.txt ) + distutils-r1_python_install_all +} |