From b17de15cba36888a79a42b636a376baec7737edc Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 20 Jul 2023 00:17:50 -0400 Subject: [PATCH] Fix tests on 32-bit --- ...ncoding_gh601-on-big-endian-machines.patch | 12 ++++---- 0002-Skip-coverage-testing.patch | 10 +++---- ...ximum-for-sizeof-test-to-pass-32-bit.patch | 29 +++++++++++++++++++ python-dask.spec | 2 ++ 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 0003-TST-Increase-maximum-for-sizeof-test-to-pass-32-bit.patch diff --git a/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch b/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch index a188b20..142a707 100644 --- a/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch +++ b/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch @@ -1,7 +1,7 @@ -From 5ee683719a19c8865a7b80725a0adf55baa3e9c9 Mon Sep 17 00:00:00 2001 +From d32c91deead99fd94cb6e95702f4b3f9ffaf37d1 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 7 Mar 2021 04:07:32 -0500 -Subject: [PATCH 1/2] Skip test_encoding_gh601 on big-endian machines. +Subject: [PATCH 1/3] Skip test_encoding_gh601 on big-endian machines. Signed-off-by: Elliott Sales de Andrade --- @@ -9,10 +9,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 2 insertions(+) diff --git a/dask/dataframe/io/tests/test_csv.py b/dask/dataframe/io/tests/test_csv.py -index b50a727b..0ac1df4c 100644 +index f40960c3..c4d516d0 100644 --- a/dask/dataframe/io/tests/test_csv.py +++ b/dask/dataframe/io/tests/test_csv.py -@@ -2,6 +2,7 @@ import gzip +@@ -4,6 +4,7 @@ import gzip import os import warnings from io import BytesIO, StringIO @@ -20,7 +20,7 @@ index b50a727b..0ac1df4c 100644 from unittest import mock import pytest -@@ -1146,6 +1147,7 @@ def test_read_csv_with_datetime_index_partitions_n(): +@@ -1149,6 +1150,7 @@ def test_read_csv_with_datetime_index_partitions_n(): xfail_pandas_100 = pytest.mark.xfail(reason="https://github.com/dask/dask/issues/5787") @@ -29,5 +29,5 @@ index b50a727b..0ac1df4c 100644 "encoding", [ -- -2.40.0 +2.41.0 diff --git a/0002-Skip-coverage-testing.patch b/0002-Skip-coverage-testing.patch index 637d7bc..c761ef3 100644 --- a/0002-Skip-coverage-testing.patch +++ b/0002-Skip-coverage-testing.patch @@ -1,7 +1,7 @@ -From 54487feeef6d7d41e3b6d4e4ece5b6342071068b Mon Sep 17 00:00:00 2001 +From 5327f35750ea3eb9daa4e4340916961d70175600 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 7 May 2023 23:13:59 -0400 -Subject: [PATCH 2/2] Skip coverage testing +Subject: [PATCH 2/3] Skip coverage testing Signed-off-by: Elliott Sales de Andrade --- @@ -9,10 +9,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml -index a7d504ff..36dfca8e 100644 +index 746e308f..20e1dbeb 100644 --- a/pyproject.toml +++ b/pyproject.toml -@@ -121,7 +121,7 @@ markers = [ +@@ -122,7 +122,7 @@ markers = [ "skip_with_pyarrow_strings: Tests that should be skipped when pyarrow string conversion is turned on", "xfail_with_pyarrow_strings: Tests that should be xfailed when pyarrow string conversion is turned on", ] @@ -22,5 +22,5 @@ index a7d504ff..36dfca8e 100644 # From Cython-1753 "ignore:can't resolve:ImportWarning", -- -2.40.0 +2.41.0 diff --git a/0003-TST-Increase-maximum-for-sizeof-test-to-pass-32-bit.patch b/0003-TST-Increase-maximum-for-sizeof-test-to-pass-32-bit.patch new file mode 100644 index 0000000..ed32597 --- /dev/null +++ b/0003-TST-Increase-maximum-for-sizeof-test-to-pass-32-bit.patch @@ -0,0 +1,29 @@ +From 088f8ba277b42e083f0fa74d7f162d42281b9f62 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Thu, 20 Jul 2023 00:05:48 -0400 +Subject: [PATCH 3/3] TST: Increase maximum for sizeof test to pass 32-bit + +In that case, the result is 1244, which is ~2.6 * `sys.sizeof` (476), +slightly over the 2 used in the existing test. + +Signed-off-by: Elliott Sales de Andrade +--- + dask/tests/test_sizeof.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dask/tests/test_sizeof.py b/dask/tests/test_sizeof.py +index 9b43a7ae..866d119b 100644 +--- a/dask/tests/test_sizeof.py ++++ b/dask/tests/test_sizeof.py +@@ -81,7 +81,7 @@ def test_pandas_multiindex(): + index = pd.MultiIndex.from_product([range(5), ["a", "b", "c", "d", "e"]]) + actual_size = sys.getsizeof(index) + +- assert 0.5 * actual_size < sizeof(index) < 2 * actual_size ++ assert 0.5 * actual_size < sizeof(index) < 3 * actual_size + assert isinstance(sizeof(index), int) + + +-- +2.41.0 + diff --git a/python-dask.spec b/python-dask.spec index 74a8a4f..05626f2 100644 --- a/python-dask.spec +++ b/python-dask.spec @@ -22,6 +22,8 @@ Source0: %{pypi_source %{srcname}} Patch: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch # Fedora-specific patch. Patch: 0002-Skip-coverage-testing.patch +# Drop after dropping 32-bit support. +Patch: 0003-TST-Increase-maximum-for-sizeof-test-to-pass-32-bit.patch %description Dask is a flexible parallel computing library for analytics.