diff options
Diffstat (limited to 'dev-python/flatbuffers')
-rw-r--r-- | dev-python/flatbuffers/Manifest | 3 | ||||
-rw-r--r-- | dev-python/flatbuffers/files/flatbuffers-24.3.25-numpy-2.patch | 72 | ||||
-rw-r--r-- | dev-python/flatbuffers/flatbuffers-24.3.25-r1.ebuild (renamed from dev-python/flatbuffers/flatbuffers-24.3.25.ebuild) | 11 |
3 files changed, 83 insertions, 3 deletions
diff --git a/dev-python/flatbuffers/Manifest b/dev-python/flatbuffers/Manifest index f86d7e41f84e..0a596c77c60d 100644 --- a/dev-python/flatbuffers/Manifest +++ b/dev-python/flatbuffers/Manifest @@ -1,3 +1,4 @@ +AUX flatbuffers-24.3.25-numpy-2.patch 2623 BLAKE2B 8a5df9dc31b4b1e46a8fe4b5bdce363ddadf96bbe36561ad1f1d51d5b402948194c838e7a2fa8ef77a49a79f6809f2c0606292fe4bfb1f97fa6bad2250da240e SHA512 f02957a07928be1845b258a85e1983ca2799e1838c9b57957841f05c4de13da8b5c50cb7c5584c104e3a9b8dcc35fe4d36fb393e363b79b25c97d8a45ea16b4a DIST flatbuffers-24.3.25.gh.tar.gz 2297829 BLAKE2B f3a5a94119a1b1b63fba9126e1cdff7ab712996bfc0d65626a679405f62dfa722bc5de244ef775fba336224b60feff3aa27acf54bed027c4013590b4afbefe7c SHA512 e2a614f4fc526ce07bfe1e1bc79efd3c87acbdb93aee7b42994d4855abd2593f36b5ca1edb53c7dcd470d5fbe14a3e394bd75dcebb4458cc0aeb33d622a3c662 -EBUILD flatbuffers-24.3.25.ebuild 831 BLAKE2B 826a9835270ba4b4a20a1aff553378b5dd49133fbc9df1c20693bbe1ef7023e1df94287931beb9e5f336a39d980848fea206436f60328074f7397df5f75be50d SHA512 f446d3c53c17e2a8f7f80bf8ba0255fee8f908bcc5822886cdd32666fa4095dc7bd735954e89371ed249490015420d284a8d920b50a834236d1d65f55a6a124c +EBUILD flatbuffers-24.3.25-r1.ebuild 970 BLAKE2B 25a39d0a03342b735ddc8be9604760bb2067a15ee959bea8f38be4e8527158a7c39db9589ccf8096cccd42c4c3791053c5c29e5c9bc131996ad61d3237cf167c SHA512 226608f166c20b5efd51da42a968a992b4e3e66153c6e7a7ef08886b1683a4e9858f7226aca46bae906d88ed3f60e131ee1a059d1e922eb1438a92079187f564 MISC metadata.xml 397 BLAKE2B 2407f1c42b05c20ddeaf0ddce303c24604be89323c35c68a0770b221f44c4fe9e0c6580e7d5f9e50d3e263f81b26935c250e45634279285ebf2c5d327220122b SHA512 635f3e14f3aa038bf8b2b7bf321e48fe4496048a11b337bab0589bab924135f8b1d216329d9326ba214e1db202ed390722345c69e3260327c2e103f5feb7fa31 diff --git a/dev-python/flatbuffers/files/flatbuffers-24.3.25-numpy-2.patch b/dev-python/flatbuffers/files/flatbuffers-24.3.25-numpy-2.patch new file mode 100644 index 000000000000..cc5846404764 --- /dev/null +++ b/dev-python/flatbuffers/files/flatbuffers-24.3.25-numpy-2.patch @@ -0,0 +1,72 @@ +From d053fbd391610e72fff1f8ee02c1222305f15de9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@gentoo.org> +Date: Mon, 1 Jul 2024 10:29:39 +0000 +Subject: [PATCH] Support for Numpy 2.0 in tests + +The newbyteorder has been removed in Numpy 2.0 [1]. Its usages are +replaced with respect to migration guide. + +[1] https://numpy.org/devdocs/numpy_2_0_migration_guide.html#ndarray-and-scalar-methods + +Fixes: #8332 + +Upstream-PR: https://github.com/google/flatbuffers/pull/8346 + +diff --git a/tests/py_test.py b/tests/py_test.py +index 7d6c0a37966..fc13a490f71 100644 +--- a/tests/py_test.py ++++ b/tests/py_test.py +@@ -1095,7 +1095,7 @@ def test_create_numpy_vector_int8(self): + + # Reverse endian: + b = flatbuffers.Builder(0) +- x_other_endian = x.byteswap().newbyteorder() ++ x_other_endian = x.byteswap().view(x.dtype.newbyteorder()) + b.CreateNumpyVector(x_other_endian) + self.assertBuilderEquals( + b, +@@ -1144,7 +1144,7 @@ def test_create_numpy_vector_uint16(self): + + # Reverse endian: + b = flatbuffers.Builder(0) +- x_other_endian = x.byteswap().newbyteorder() ++ x_other_endian = x.byteswap().view(x.dtype.newbyteorder()) + b.CreateNumpyVector(x_other_endian) + self.assertBuilderEquals( + b, +@@ -1213,7 +1213,7 @@ def test_create_numpy_vector_int64(self): + + # Reverse endian: + b = flatbuffers.Builder(0) +- x_other_endian = x.byteswap().newbyteorder() ++ x_other_endian = x.byteswap().view(x.dtype.newbyteorder()) + b.CreateNumpyVector(x_other_endian) + self.assertBuilderEquals( + b, +@@ -1287,7 +1287,7 @@ def test_create_numpy_vector_float32(self): + + # Reverse endian: + b = flatbuffers.Builder(0) +- x_other_endian = x.byteswap().newbyteorder() ++ x_other_endian = x.byteswap().view(x.dtype.newbyteorder()) + b.CreateNumpyVector(x_other_endian) + self.assertBuilderEquals( + b, +@@ -1361,7 +1361,7 @@ def test_create_numpy_vector_float64(self): + + # Reverse endian: + b = flatbuffers.Builder(0) +- x_other_endian = x.byteswap().newbyteorder() ++ x_other_endian = x.byteswap().view(x.dtype.newbyteorder()) + b.CreateNumpyVector(x_other_endian) + self.assertBuilderEquals( + b, +@@ -1427,7 +1427,7 @@ def test_create_numpy_vector_bool(self): + + # Reverse endian: + b = flatbuffers.Builder(0) +- x_other_endian = x.byteswap().newbyteorder() ++ x_other_endian = x.byteswap().view(x.dtype.newbyteorder()) + b.CreateNumpyVector(x_other_endian) + self.assertBuilderEquals( + b, diff --git a/dev-python/flatbuffers/flatbuffers-24.3.25.ebuild b/dev-python/flatbuffers/flatbuffers-24.3.25-r1.ebuild index f8473ffd984c..bfb978e1fb13 100644 --- a/dev-python/flatbuffers/flatbuffers-24.3.25.ebuild +++ b/dev-python/flatbuffers/flatbuffers-24.3.25-r1.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..12} ) +PYTHON_COMPAT=( python3_{10..13} ) inherit distutils-r1 @@ -27,10 +27,17 @@ RESTRICT="!test? ( test )" BDEPEND=" test? ( - <dev-python/numpy-2[${PYTHON_USEDEP}] + dev-python/numpy[${PYTHON_USEDEP}] ) " +src_prepare() { + cd "${WORKDIR}/${P}" || die + eapply "${FILESDIR}/${PN}-24.3.25-numpy-2.patch" + cd "${S}" || die + distutils-r1_src_prepare +} + python_test() { cd "${WORKDIR}/${P}/tests" || die # zeroes means without benchmarks |