From 9934e1ad393b8b63167152b2fc7c8561319b947f Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 27 Aug 2023 02:00:01 -0400 Subject: [PATCH] Fix test on s390x using Debian patch --- force-little-endian-random.patch | 19 +++++++++++++++++++ python-dask.spec | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 force-little-endian-random.patch diff --git a/force-little-endian-random.patch b/force-little-endian-random.patch new file mode 100644 index 0000000..87c9cc1 --- /dev/null +++ b/force-little-endian-random.patch @@ -0,0 +1,19 @@ +Author: Diane Trout +Description: Force initializing the random seed with the same + byte order interpretation as on x86. + +Index: dask-2023.8.0+dfsg/dask/utils.py +=================================================================== +--- dask-2023.8.0+dfsg.orig/dask/utils.py ++++ dask-2023.8.0+dfsg/dask/utils.py +@@ -426,7 +426,9 @@ def random_state_data(n: int, random_sta + random_state = np.random.RandomState(random_state) + + random_data = random_state.bytes(624 * n * 4) # `n * 624` 32-bit integers +- l = list(np.frombuffer(random_data, dtype=np.uint32).reshape((n, -1))) ++ dt = np.dtype(np.uint32) ++ dt = dt.newbyteorder("<") ++ l = list(np.frombuffer(random_data, dtype=dt).reshape((n, -1))) + assert len(l) == n + return l + diff --git a/python-dask.spec b/python-dask.spec index bccf93c..ad3a588 100644 --- a/python-dask.spec +++ b/python-dask.spec @@ -26,6 +26,8 @@ Patch: 0002-Skip-coverage-testing.patch Patch: 0003-TST-Increase-maximum-for-sizeof-test-to-pass-32-bit.patch # https://github.com/dask/dask/pull/10451 Patch: 0004-Fix-test_pandas_timestamp_overflow_pyarrow-condition.patch +# https://github.com/dask/dask/issues/10423 +Patch: https://salsa.debian.org/python-team/packages/dask/-/raw/08ffea1b7b53e9c71c9a926d5786288c2e6c1b5b/debian/patches/force-little-endian-random.patch %description Dask is a flexible parallel computing library for analytics.