summaryrefslogtreecommitdiff
path: root/dev-python/flatbuffers
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2024-07-01 17:43:57 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2024-07-01 17:43:57 +0000
commit92f138c6c660a6a68a843c8c394a93999455bee7 (patch)
treebc5f2b61024cea20c7bbed714634b64b4c8c3955 /dev-python/flatbuffers
parent2f038d1a0bc791d17fb3e5fe366be075a7f68aac (diff)
downloadbaldeagleos-repo-92f138c6c660a6a68a843c8c394a93999455bee7.tar.gz
baldeagleos-repo-92f138c6c660a6a68a843c8c394a93999455bee7.tar.xz
baldeagleos-repo-92f138c6c660a6a68a843c8c394a93999455bee7.zip
Adding metadata
Diffstat (limited to 'dev-python/flatbuffers')
-rw-r--r--dev-python/flatbuffers/files/flatbuffers-24.3.25-numpy-2.patch72
-rw-r--r--dev-python/flatbuffers/flatbuffers-24.3.25-r1.ebuild46
2 files changed, 118 insertions, 0 deletions
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-r1.ebuild b/dev-python/flatbuffers/flatbuffers-24.3.25-r1.ebuild
new file mode 100644
index 000000000000..813fed0c5c23
--- /dev/null
+++ b/dev-python/flatbuffers/flatbuffers-24.3.25-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8,9,10,11,12} )
+
+inherit distutils-r1
+
+DESCRIPTION="RFC 7049 - Concise Binary Object Representation"
+HOMEPAGE="
+ https://github.com/google/flatbuffers/
+ https://pypi.org/project/flatbuffers/
+"
+SRC_URI="
+ https://github.com/google/${PN}/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+S=${WORKDIR}/${P}/python
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~sparc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ test? (
+ 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
+ "${EPYTHON}" py_test.py 0 0 0 0 false || die
+ "${EPYTHON}" py_flexbuffers_test.py -v || die
+}