From 4898f38b8a9e4f863640a4ca4cb564e6c90ce3d6 Mon Sep 17 00:00:00 2001 From: Joel Capitao Date: Nov 07 2024 08:34:57 +0000 Subject: Import python-pandas-2.2.1-7.el10~bootstrap in CloudSIG Epoxy --- diff --git a/.python-pandas.metadata b/.python-pandas.metadata new file mode 100644 index 0000000..d372021 --- /dev/null +++ b/.python-pandas.metadata @@ -0,0 +1 @@ +b915acaf67c259579ec82331b8f90af1fa4861bc SOURCES/pandas-2.2.1.tar.gz diff --git a/SOURCES/0001-TST-Ensure-Matplotlib-is-always-cleaned-up.patch b/SOURCES/0001-TST-Ensure-Matplotlib-is-always-cleaned-up.patch new file mode 100644 index 0000000..c74b88c --- /dev/null +++ b/SOURCES/0001-TST-Ensure-Matplotlib-is-always-cleaned-up.patch @@ -0,0 +1,157 @@ +From dc3ad727ff8eb90e7313766cced271faa0f7353d Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Mon, 12 Feb 2024 19:36:32 -0500 +Subject: [PATCH 1/6] TST: Ensure Matplotlib is always cleaned up + +The seaborn test also uses Matplotlib but was not wrapped in the cleanup +fixture, As there are now 3 files that need this fixture, refactor to +reduce code duplication. + +Signed-off-by: Elliott Sales de Andrade +--- + pandas/conftest.py | 34 +++++++++++++++++++ + .../tests/io/formats/style/test_matplotlib.py | 21 +----------- + pandas/tests/plotting/conftest.py | 21 ++---------- + pandas/tests/test_downstream.py | 2 +- + 4 files changed, 38 insertions(+), 40 deletions(-) + +diff --git a/pandas/conftest.py b/pandas/conftest.py +index 7c35dfdde9..2d37e3f843 100644 +--- a/pandas/conftest.py ++++ b/pandas/conftest.py +@@ -28,6 +28,7 @@ from datetime import ( + timezone, + ) + from decimal import Decimal ++import gc + import operator + import os + from typing import ( +@@ -1809,6 +1810,39 @@ def ip(): + return InteractiveShell(config=c) + + ++@pytest.fixture ++def mpl_cleanup(): ++ """ ++ Ensure Matplotlib is cleaned up around a test. ++ ++ Before a test is run: ++ ++ 1) Set the backend to "template" to avoid requiring a GUI. ++ ++ After a test is run: ++ ++ 1) Reset units registry ++ 2) Reset rc_context ++ 3) Close all figures ++ ++ See matplotlib/testing/decorators.py#L24. ++ """ ++ mpl = pytest.importorskip("matplotlib") ++ mpl_units = pytest.importorskip("matplotlib.units") ++ plt = pytest.importorskip("matplotlib.pyplot") ++ orig_units_registry = mpl_units.registry.copy() ++ try: ++ with mpl.rc_context(): ++ mpl.use("template") ++ yield ++ finally: ++ mpl_units.registry.clear() ++ mpl_units.registry.update(orig_units_registry) ++ plt.close("all") ++ # https://matplotlib.org/stable/users/prev_whats_new/whats_new_3.6.0.html#garbage-collection-is-no-longer-run-on-figure-close # noqa: E501 ++ gc.collect(1) ++ ++ + @pytest.fixture(params=["bsr", "coo", "csc", "csr", "dia", "dok", "lil"]) + def spmatrix(request): + """ +diff --git a/pandas/tests/io/formats/style/test_matplotlib.py b/pandas/tests/io/formats/style/test_matplotlib.py +index fb7a77f1dd..aacab81032 100644 +--- a/pandas/tests/io/formats/style/test_matplotlib.py ++++ b/pandas/tests/io/formats/style/test_matplotlib.py +@@ -1,5 +1,3 @@ +-import gc +- + import numpy as np + import pytest + +@@ -17,24 +15,7 @@ import matplotlib as mpl + from pandas.io.formats.style import Styler + + +-@pytest.fixture(autouse=True) +-def mpl_cleanup(): +- # matplotlib/testing/decorators.py#L24 +- # 1) Resets units registry +- # 2) Resets rc_context +- # 3) Closes all figures +- mpl = pytest.importorskip("matplotlib") +- mpl_units = pytest.importorskip("matplotlib.units") +- plt = pytest.importorskip("matplotlib.pyplot") +- orig_units_registry = mpl_units.registry.copy() +- with mpl.rc_context(): +- mpl.use("template") +- yield +- mpl_units.registry.clear() +- mpl_units.registry.update(orig_units_registry) +- plt.close("all") +- # https://matplotlib.org/stable/users/prev_whats_new/whats_new_3.6.0.html#garbage-collection-is-no-longer-run-on-figure-close # noqa: E501 +- gc.collect(1) ++pytestmark = pytest.mark.usefixtures("mpl_cleanup") + + + @pytest.fixture +diff --git a/pandas/tests/plotting/conftest.py b/pandas/tests/plotting/conftest.py +index d688bbd475..eb5a1f1f63 100644 +--- a/pandas/tests/plotting/conftest.py ++++ b/pandas/tests/plotting/conftest.py +@@ -1,5 +1,3 @@ +-import gc +- + import numpy as np + import pytest + +@@ -10,23 +8,8 @@ from pandas import ( + + + @pytest.fixture(autouse=True) +-def mpl_cleanup(): +- # matplotlib/testing/decorators.py#L24 +- # 1) Resets units registry +- # 2) Resets rc_context +- # 3) Closes all figures +- mpl = pytest.importorskip("matplotlib") +- mpl_units = pytest.importorskip("matplotlib.units") +- plt = pytest.importorskip("matplotlib.pyplot") +- orig_units_registry = mpl_units.registry.copy() +- with mpl.rc_context(): +- mpl.use("template") +- yield +- mpl_units.registry.clear() +- mpl_units.registry.update(orig_units_registry) +- plt.close("all") +- # https://matplotlib.org/stable/users/prev_whats_new/whats_new_3.6.0.html#garbage-collection-is-no-longer-run-on-figure-close # noqa: E501 +- gc.collect(1) ++def autouse_mpl_cleanup(mpl_cleanup): ++ pass + + + @pytest.fixture +diff --git a/pandas/tests/test_downstream.py b/pandas/tests/test_downstream.py +index 51ce73ef54..bc8af95766 100644 +--- a/pandas/tests/test_downstream.py ++++ b/pandas/tests/test_downstream.py +@@ -153,7 +153,7 @@ def test_scikit_learn(): + clf.predict(digits.data[-1:]) + + +-def test_seaborn(): ++def test_seaborn(mpl_cleanup): + seaborn = pytest.importorskip("seaborn") + tips = DataFrame( + {"day": pd.date_range("2023", freq="D", periods=5), "total_bill": range(5)} +-- +2.43.0 + diff --git a/SOURCES/0002-Fix-evaluations-on-Python-3.12.patch b/SOURCES/0002-Fix-evaluations-on-Python-3.12.patch new file mode 100644 index 0000000..3d035a3 --- /dev/null +++ b/SOURCES/0002-Fix-evaluations-on-Python-3.12.patch @@ -0,0 +1,67 @@ +From 76aaa36bfaa7a22cfc2fe49e59400873c0c2c3e2 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Mon, 12 Feb 2024 19:47:57 -0500 +Subject: [PATCH 2/6] Fix evaluations on Python 3.12 + +List comprehensions no longer get their own scope [1], so adding a level +to the (eventual) call to `sys._getframe` goes outside the actual +caller. If running in `pytest` (so that there is a scope outside the +caller), you end up looking in some unrelated scope. If you are running +a script, then `sys._getframe` raises an error that the level is out of +bounds. + +The `Bitwise operations` warning in `test_scalar_unary` appears to +always be raised, so remove the condition. + +[1] https://docs.python.org/3.12/whatsnew/3.12.html#whatsnew312-pep709 + +Signed-off-by: Elliott Sales de Andrade +--- + pandas/io/pytables.py | 7 ++++++- + pandas/tests/computation/test_eval.py | 4 +--- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py +index 1139519d2b..b3ed92a725 100644 +--- a/pandas/io/pytables.py ++++ b/pandas/io/pytables.py +@@ -40,6 +40,7 @@ from pandas._libs import ( + ) + from pandas._libs.lib import is_string_array + from pandas._libs.tslibs import timezones ++from pandas.compat import PY312 + from pandas.compat._optional import import_optional_dependency + from pandas.compat.pickle_compat import patch_pickle + from pandas.errors import ( +@@ -178,8 +179,12 @@ def _ensure_term(where, scope_level: int): + # list + level = scope_level + 1 + if isinstance(where, (list, tuple)): ++ # Python 3.12 does not a scope for list comprehensions, but older versions did: ++ # https://docs.python.org/3.12/whatsnew/3.12.html#whatsnew312-pep709 ++ if not PY312: ++ level += 1 + where = [ +- Term(term, scope_level=level + 1) if maybe_expression(term) else term ++ Term(term, scope_level=level) if maybe_expression(term) else term + for term in where + if term is not None + ] +diff --git a/pandas/tests/computation/test_eval.py b/pandas/tests/computation/test_eval.py +index 17630f14b0..eab14c3fcd 100644 +--- a/pandas/tests/computation/test_eval.py ++++ b/pandas/tests/computation/test_eval.py +@@ -557,9 +557,7 @@ class TestEval: + + def test_scalar_unary(self, engine, parser): + msg = "bad operand type for unary ~: 'float'" +- warn = None +- if PY312 and not (engine == "numexpr" and parser == "pandas"): +- warn = DeprecationWarning ++ warn = DeprecationWarning if PY312 else None + with pytest.raises(TypeError, match=msg): + pd.eval("~1.0", engine=engine, parser=parser) + +-- +2.43.0 + diff --git a/SOURCES/0003-TST-Fix-IntervalIndex-constructor-tests-on-big-endia.patch b/SOURCES/0003-TST-Fix-IntervalIndex-constructor-tests-on-big-endia.patch new file mode 100644 index 0000000..7f81415 --- /dev/null +++ b/SOURCES/0003-TST-Fix-IntervalIndex-constructor-tests-on-big-endia.patch @@ -0,0 +1,37 @@ +From 607aa65e82e0fae1e9e4666206f746d7ffc1a3b7 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Mon, 12 Feb 2024 22:39:36 -0500 +Subject: [PATCH 3/6] TST: Fix IntervalIndex constructor tests on big-endian + systems + +Two tests cases specify the expected data to be little-endian. However, +none of the other cases do so, and the test creates native endian data, +causing these tests to fail only in these specific cases. + +Signed-off-by: Elliott Sales de Andrade +--- + pandas/tests/indexes/interval/test_constructors.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pandas/tests/indexes/interval/test_constructors.py b/pandas/tests/indexes/interval/test_constructors.py +index e47a014f18..28a6ac4c6d 100644 +--- a/pandas/tests/indexes/interval/test_constructors.py ++++ b/pandas/tests/indexes/interval/test_constructors.py +@@ -44,12 +44,12 @@ class ConstructorTests: + (Index(np.arange(-10, 11, dtype=np.int64)), np.int64), + (Index(np.arange(10, 31, dtype=np.uint64)), np.uint64), + (Index(np.arange(20, 30, 0.5), dtype=np.float64), np.float64), +- (date_range("20180101", periods=10), " +Date: Mon, 12 Feb 2024 23:34:02 -0500 +Subject: [PATCH 4/6] TST: Fix test_str_encode on big endian machines + +I couldn't find a way to specify the endianness when creating the +`ArrowDtype`, so just pick the right result based on native byte order. + +Signed-off-by: Elliott Sales de Andrade +--- + pandas/tests/extension/test_arrow.py | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py +index d9a3033b83..c551fff040 100644 +--- a/pandas/tests/extension/test_arrow.py ++++ b/pandas/tests/extension/test_arrow.py +@@ -26,6 +26,7 @@ from io import ( + import operator + import pickle + import re ++import sys + + import numpy as np + import pytest +@@ -2106,14 +2107,21 @@ def test_str_removeprefix(val): + @pytest.mark.parametrize( + "encoding, exp", + [ +- ["utf8", b"abc"], +- ["utf32", b"\xff\xfe\x00\x00a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00"], ++ ("utf8", {"little": b"abc", "big": "abc"}), ++ ( ++ "utf32", ++ { ++ "little": b"\xff\xfe\x00\x00a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00", ++ "big": b"\x00\x00\xfe\xff\x00\x00\x00a\x00\x00\x00b\x00\x00\x00c", ++ }, ++ ), + ], ++ ids=["utf8", "utf32"], + ) + def test_str_encode(errors, encoding, exp): + ser = pd.Series(["abc", None], dtype=ArrowDtype(pa.string())) + result = ser.str.encode(encoding, errors) +- expected = pd.Series([exp, None], dtype=ArrowDtype(pa.binary())) ++ expected = pd.Series([exp[sys.byteorder], None], dtype=ArrowDtype(pa.binary())) + tm.assert_series_equal(result, expected) + + +-- +2.43.0 + diff --git a/SOURCES/0005-TST-Add-missing-skips-for-unavailable-pyarrow.patch b/SOURCES/0005-TST-Add-missing-skips-for-unavailable-pyarrow.patch new file mode 100644 index 0000000..f3c78cc --- /dev/null +++ b/SOURCES/0005-TST-Add-missing-skips-for-unavailable-pyarrow.patch @@ -0,0 +1,74 @@ +From b022df8968b889c8f55832a909c602840cfe1840 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Tue, 13 Feb 2024 02:20:43 -0500 +Subject: [PATCH 5/6] TST: Add missing skips for unavailable pyarrow + +The `all_parsers` fixture has this check, but some of the other fixtures +were missing it. + +Signed-off-by: Elliott Sales de Andrade +--- + pandas/core/arrays/arrow/accessors.py | 2 +- + pandas/tests/io/formats/style/test_bar.py | 3 +++ + pandas/tests/io/parser/conftest.py | 4 ++++ + 3 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/pandas/core/arrays/arrow/accessors.py b/pandas/core/arrays/arrow/accessors.py +index 124f8fb6ad..3175781e53 100644 +--- a/pandas/core/arrays/arrow/accessors.py ++++ b/pandas/core/arrays/arrow/accessors.py +@@ -46,7 +46,7 @@ class ArrowAccessor(metaclass=ABCMeta): + + def _validate(self, data): + dtype = data.dtype +- if not isinstance(dtype, ArrowDtype): ++ if not pa_version_under10p1 and not isinstance(dtype, ArrowDtype): + # Raise AttributeError so that inspect can handle non-struct Series. + raise AttributeError(self._validation_msg.format(dtype=dtype)) + +diff --git a/pandas/tests/io/formats/style/test_bar.py b/pandas/tests/io/formats/style/test_bar.py +index b0e4712e8b..41206da56e 100644 +--- a/pandas/tests/io/formats/style/test_bar.py ++++ b/pandas/tests/io/formats/style/test_bar.py +@@ -3,6 +3,8 @@ import io + import numpy as np + import pytest + ++from pandas.compat._optional import VERSIONS ++ + from pandas import ( + NA, + DataFrame, +@@ -347,6 +349,7 @@ def test_styler_bar_with_NA_values(): + + + def test_style_bar_with_pyarrow_NA_values(): ++ pytest.importorskip("pyarrow", VERSIONS["pyarrow"]) + data = """name,age,test1,test2,teacher + Adam,15,95.0,80,Ashby + Bob,16,81.0,82,Ashby +diff --git a/pandas/tests/io/parser/conftest.py b/pandas/tests/io/parser/conftest.py +index 6d5f870f07..88ccf5fee8 100644 +--- a/pandas/tests/io/parser/conftest.py ++++ b/pandas/tests/io/parser/conftest.py +@@ -165,6 +165,7 @@ def pyarrow_parser_only(request): + """ + Fixture all of the CSV parsers using the Pyarrow engine. + """ ++ pytest.importorskip("pyarrow", VERSIONS["pyarrow"]) + return request.param() + + +@@ -198,6 +199,9 @@ def all_parsers_all_precisions(request): + Fixture for all allowable combinations of parser + and float precision + """ ++ parser = request.param[0] ++ if parser.engine == "pyarrow": ++ pytest.importorskip("pyarrow", VERSIONS["pyarrow"]) + return request.param + + +-- +2.43.0 + diff --git a/SOURCES/0006-Fix-accidental-loss-of-precision-for-to_datetime-str.patch b/SOURCES/0006-Fix-accidental-loss-of-precision-for-to_datetime-str.patch new file mode 100644 index 0000000..bad9357 --- /dev/null +++ b/SOURCES/0006-Fix-accidental-loss-of-precision-for-to_datetime-str.patch @@ -0,0 +1,61 @@ +From cbf5299a065e20a5b129ad5eed6953262ce54f37 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Wed, 21 Feb 2024 06:55:19 -0500 +Subject: [PATCH 6/6] Fix accidental loss-of-precision for to_datetime(str, + unit=...) + +In Pandas 1.5.3, the `float(val)` cast was inline to the +`cast_from_unit` call in `array_with_unit_to_datetime`. This caused the +intermediate (unnamed) value to be a Python float. + +Since #50301, a temporary variable was added to avoid multiple casts, +but with explicit type `cdef float`, which defines a _Cython_ float. +This type is 32-bit, and causes a loss of precision, and a regression in +parsing from 1.5.3. + +So widen the explicit type of the temporary `fval` variable to (64-bit) +`double`, which will not lose precision. + +Fixes #57051 + +Signed-off-by: Elliott Sales de Andrade +--- + pandas/_libs/tslib.pyx | 2 +- + pandas/tests/tools/test_to_datetime.py | 8 ++++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/pandas/_libs/tslib.pyx b/pandas/_libs/tslib.pyx +index 017fdc4bc8..dd23c2f27c 100644 +--- a/pandas/_libs/tslib.pyx ++++ b/pandas/_libs/tslib.pyx +@@ -277,7 +277,7 @@ def array_with_unit_to_datetime( + bint is_raise = errors == "raise" + ndarray[int64_t] iresult + tzinfo tz = None +- float fval ++ double fval + + assert is_ignore or is_coerce or is_raise + +diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py +index 6791ac0340..a4194dcff2 100644 +--- a/pandas/tests/tools/test_to_datetime.py ++++ b/pandas/tests/tools/test_to_datetime.py +@@ -1912,6 +1912,14 @@ class TestToDatetimeUnit: + with pytest.raises(ValueError, match=msg): + to_datetime([1], unit="D", format="%Y%m%d", cache=cache) + ++ def test_unit_str(self, cache): ++ # GH 57051 ++ # Test that strs aren't dropping precision to 32-bit accidentally. ++ with tm.assert_produces_warning(FutureWarning): ++ res = pd.to_datetime(["1704660000"], unit="s", origin="unix") ++ expected = pd.to_datetime([1704660000], unit="s", origin="unix") ++ tm.assert_index_equal(res, expected) ++ + def test_unit_array_mixed_nans(self, cache): + values = [11111111111111111, 1, 1.0, iNaT, NaT, np.nan, "NaT", ""] + result = to_datetime(values, unit="D", errors="ignore", cache=cache) +-- +2.43.0 + diff --git a/SOURCES/0007-Fix-Python-3.13-test-failures.patch b/SOURCES/0007-Fix-Python-3.13-test-failures.patch new file mode 100644 index 0000000..49a781d --- /dev/null +++ b/SOURCES/0007-Fix-Python-3.13-test-failures.patch @@ -0,0 +1,126 @@ +From 9e68917ce80372791cc3e852032b039fd341c428 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Tue, 25 Jun 2024 18:51:29 -0600 +Subject: [PATCH 7/7] Fix Python 3.13 test failures + +--- + pandas/_libs/src/vendored/ujson/python/objToJSON.c | 12 ++++++------ + pandas/_libs/tslibs/offsets.pyx | 7 ++++++- + pandas/tests/io/parser/test_dialect.py | 2 +- + pandas/tests/io/test_common.py | 5 ++++- + pandas/tests/io/xml/test_xml.py | 2 +- + pandas/tests/scalar/timedelta/test_arithmetic.py | 1 + + 6 files changed, 19 insertions(+), 10 deletions(-) + +diff --git a/pandas/_libs/src/vendored/ujson/python/objToJSON.c b/pandas/_libs/src/vendored/ujson/python/objToJSON.c +index 74ca8ea..6ee2f82 100644 +--- a/pandas/_libs/src/vendored/ujson/python/objToJSON.c ++++ b/pandas/_libs/src/vendored/ujson/python/objToJSON.c +@@ -412,8 +412,8 @@ static void NpyArr_iterBegin(JSOBJ _obj, JSONTypeContext *tc) { + npyarr->type_num = PyArray_DESCR(obj)->type_num; + + if (GET_TC(tc)->transpose) { +- npyarr->dim = PyArray_DIM(obj, npyarr->ndim); +- npyarr->stride = PyArray_STRIDE(obj, npyarr->ndim); ++ npyarr->dim = PyArray_DIM(obj, (int)npyarr->ndim); ++ npyarr->stride = PyArray_STRIDE(obj, (int)npyarr->ndim); + npyarr->stridedim = npyarr->ndim; + npyarr->index[npyarr->ndim] = 0; + npyarr->inc = -1; +@@ -454,8 +454,8 @@ static void NpyArrPassThru_iterEnd(JSOBJ obj, JSONTypeContext *tc) { + return; + } + const PyArrayObject *arrayobj = (const PyArrayObject *)npyarr->array; +- npyarr->dim = PyArray_DIM(arrayobj, npyarr->stridedim); +- npyarr->stride = PyArray_STRIDE(arrayobj, npyarr->stridedim); ++ npyarr->dim = PyArray_DIM(arrayobj, (int)npyarr->stridedim); ++ npyarr->stride = PyArray_STRIDE(arrayobj, (int)npyarr->stridedim); + npyarr->dataptr += npyarr->stride; + + NpyArr_freeItemValue(obj, tc); +@@ -526,8 +526,8 @@ static int NpyArr_iterNext(JSOBJ _obj, JSONTypeContext *tc) { + } + const PyArrayObject *arrayobj = (const PyArrayObject *)npyarr->array; + +- npyarr->dim = PyArray_DIM(arrayobj, npyarr->stridedim); +- npyarr->stride = PyArray_STRIDE(arrayobj, npyarr->stridedim); ++ npyarr->dim = PyArray_DIM(arrayobj, (int)npyarr->stridedim); ++ npyarr->stride = PyArray_STRIDE(arrayobj, (int)npyarr->stridedim); + npyarr->index[npyarr->stridedim] = 0; + + ((PyObjectEncoder *)tc->encoder)->npyCtxtPassthru = npyarr; +diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx +index c37a4b2..5dacd7d 100644 +--- a/pandas/_libs/tslibs/offsets.pyx ++++ b/pandas/_libs/tslibs/offsets.pyx +@@ -4960,7 +4960,12 @@ cpdef to_offset(freq, bint is_period=False): + if result is None: + raise ValueError(INVALID_FREQ_ERR_MSG.format(freq)) + +- if is_period and not hasattr(result, "_period_dtype_code"): ++ try: ++ has_period_dtype_code = hasattr(result, "_period_dtype_code") ++ except ValueError: ++ has_period_dtype_code = False ++ ++ if is_period and not has_period_dtype_code: + if isinstance(freq, str): + raise ValueError(f"{result.name} is not supported as period frequency") + else: +diff --git a/pandas/tests/io/parser/test_dialect.py b/pandas/tests/io/parser/test_dialect.py +index 7a72e66..8031147 100644 +--- a/pandas/tests/io/parser/test_dialect.py ++++ b/pandas/tests/io/parser/test_dialect.py +@@ -26,7 +26,7 @@ def custom_dialect(): + "escapechar": "~", + "delimiter": ":", + "skipinitialspace": False, +- "quotechar": "~", ++ "quotechar": "`", + "quoting": 3, + } + return dialect_name, dialect_kwargs +diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py +index 0740338..e51f865 100644 +--- a/pandas/tests/io/test_common.py ++++ b/pandas/tests/io/test_common.py +@@ -485,7 +485,10 @@ class TestMMapWrapper: + df.to_csv(path, compression=compression_, encoding=encoding) + + # reading should fail (otherwise we wouldn't need the warning) +- msg = r"UTF-\d+ stream does not start with BOM" ++ msg = ( ++ r"UTF-\d+ stream does not start with BOM|" ++ r"'utf-\d+' codec can't decode byte" ++ ) + with pytest.raises(UnicodeError, match=msg): + pd.read_csv(path, compression=compression_, encoding=encoding) + +diff --git a/pandas/tests/io/xml/test_xml.py b/pandas/tests/io/xml/test_xml.py +index 6f429c1..900734e 100644 +--- a/pandas/tests/io/xml/test_xml.py ++++ b/pandas/tests/io/xml/test_xml.py +@@ -1044,7 +1044,7 @@ def test_utf16_encoding(xml_baby_names, parser): + UnicodeError, + match=( + "UTF-16 stream does not start with BOM|" +- "'utf-16-le' codec can't decode byte" ++ "'utf-16(-le)?' codec can't decode byte" + ), + ): + read_xml(xml_baby_names, encoding="UTF-16", parser=parser) +diff --git a/pandas/tests/scalar/timedelta/test_arithmetic.py b/pandas/tests/scalar/timedelta/test_arithmetic.py +index d2fa0f7..33ac121 100644 +--- a/pandas/tests/scalar/timedelta/test_arithmetic.py ++++ b/pandas/tests/scalar/timedelta/test_arithmetic.py +@@ -622,6 +622,7 @@ class TestTimedeltaMultiplicationDivision: + [ + r"Invalid dtype datetime64\[D\] for __floordiv__", + "'dtype' is an invalid keyword argument for this function", ++ "this function got an unexpected keyword argument 'dtype'", + r"ufunc '?floor_divide'? cannot use operands with types", + ] + ) +-- +2.45.2 + diff --git a/SPECS/python-pandas.spec b/SPECS/python-pandas.spec new file mode 100644 index 0000000..03a7a05 --- /dev/null +++ b/SPECS/python-pandas.spec @@ -0,0 +1,1050 @@ +# We need to break some cycles with optional dependencies for bootstrapping; +# given that a conditional is needed, we take the opportunity to omit as many +# optional dependencies as possible for bootstrapping. +%bcond_without bootstrap + +# When not bootstrapping, run tests? +%bcond_without tests +%{?with_bootstrap:%undefine with_tests} +# When running tests, run ones that are marked as slow? +%bcond_without slow_tests +# When running tests, run ones that cannot be run in parallel? +%bcond_without single_tests + +Name: python-pandas +Version: 2.2.1 +Release: 7%{?dist} +Summary: Python library providing high-performance data analysis tools + +# Drop support for i686 in preparation for `libarrow` +# https://bugzilla.redhat.com/show_bug.cgi?id=2263999 +ExcludeArch: %{ix86} + +# The entire source is BSD-3-Clause and covered by LICENSE, except: +# +# - pandas/util/version/__init__.py is (Apache-2.0 OR BSD-2-Clause): see +# LICENSES/PACKAGING_LICENSE +# - pandas/_libs/src/headers/portable.h is (BSD-3-Clause AND MIT), because it +# contains some trivial content under the overall BSD-3-Clause license but +# also some macros from MUSL libc under the MIT license: see +# LICENSES/MUSL_LICENSE +# - pandas/_libs/src/parser/tokenizer.c is (BSD-3-Clause AND Python-2.0.1): see +# LICENSES/PSF_LICENSE +# - pandas/io/sas/sas7bdat.py is (BSD-3-Clause and MIT), because it is mostly +# under the overall BSD-3-Clause license but is also based on +# https://bitbucket.org/jaredhobbs/sas7bdat: see LICENSES/SAS7BDAT_LICENSE +# - pandas/core/accessor.py is (BSD-3-Clause AND Apache-2.0), because it is +# partially under the overall BSD-3-Clause license but is also based on +# xarray: see LICENSES/XARRAY_LICENSE +# - pandas/_libs/src/klib/khash.h is MIT: see LICENSES/KLIB_LICENSE +# - pandas/_libs/window/aggregations.pyx is (BSD-3-Clause AND BSD-2-Clause): +# see “Bottleneck license” in LICENSES/OTHER +# +# In the python3-pandas+test subpackage: +# +# - pandas/tests/io/data/spss/*.sav are MIT: see LICENSES/HAVEN_LICENSE and +# LICENSES/HAVEN_MIT +# - pandas/tests/window/test_rolling.py is (BSD-3-Clause AND BSD-2-Clause) +# since test_rolling_std_neg_sqrt is from Bottleneck: see “Bottleneck license” +# in LICENSES/OTHER +# +# Additionally: +# +# - pandas/_libs/tslibs/parsing.pyx is BSD-3-Clause rather than +# (BSD-3-Clause AND (BSD-3-Clause OR Apache-2.0)), because it appears that at +# least some trivial content in the code copied from dateutil in the +# dateutil_parse() function (as of +# https://github.com/dateutil/dateutil/pull/732) is by dateutil contributors +# who have not agreed to re-license their previously submitted code: see +# LICENSES/DATEUTIL_LICENSE. +# - LICENSES/OTHER suggests that some code may be derived from +# google-api-python-client under Apache-2.0, but a search for attribution +# comments did not turn up anything specific +# - pandas/_libs/tslibs/src/datetime/np_datetime.{h,c} are still BSD-3-Clause, +# but see also LICENSES/NUMPY_LICENSE +# - pandas/io/clipboard/ is still BSD-3-Clause, but see also “Pyperclip v1.3 +# license” in LICENSES/OTHER +# - pandas/_testing/__init__.py is still BSD-3-Clause, but see also +# LICENSES/SCIPY_LICENSE +# - pandas/_libs/src/ujson/lib/ is still BSD-3-Clause, but under +# LICENSES/ULTRAJSON_LICENSE +# +# Additionally, the following are not packaged and so do not affect the overall +# License field: +# +# - scripts/no_bool_in_generic.py is MIT: see LICENSES/PYUPGRADE_LICENSE +License: BSD-3-Clause AND (Apache-2.0 OR BSD-2-Clause) AND (BSD-3-Clause AND Apache-2.0) AND (BSD-3-Clause AND MIT) AND (BSD-3-Clause AND Python-2.0.1) AND MIT AND (BSD-3-Clause AND BSD-2-Clause) +URL: https://pandas.pydata.org/ +# The GitHub archive contains tests; the PyPI sdist does not. +Source0: https://github.com/pandas-dev/pandas/archive/v%{version}/pandas-%{version}.tar.gz +# https://github.com/pandas-dev/pandas/pull/57389 +Patch: 0001-TST-Ensure-Matplotlib-is-always-cleaned-up.patch +# https://github.com/pandas-dev/pandas/pull/57391 +Patch: 0002-Fix-evaluations-on-Python-3.12.patch +# Fix big-endian issues: +# https://github.com/pandas-dev/pandas/pull/57393 +Patch: 0003-TST-Fix-IntervalIndex-constructor-tests-on-big-endia.patch +# https://github.com/pandas-dev/pandas/issues/57373 +# https://github.com/pandas-dev/pandas/pull/57394 +Patch: 0004-TST-Fix-test_str_encode-on-big-endian-machines.patch +# https://github.com/pandas-dev/pandas/pull/57397 +Patch: 0005-TST-Add-missing-skips-for-unavailable-pyarrow.patch +# https://github.com/pandas-dev/pandas/pull/57548 +Patch: 0006-Fix-accidental-loss-of-precision-for-to_datetime-str.patch +# Python 3.13 support https://github.com/pandas-dev/pandas/pull/59065 +Patch: 0007-Fix-Python-3.13-test-failures.patch + +%global _description %{expand: +pandas is an open source, BSD-licensed library providing +high-performance, easy-to-use data structures and data +analysis tools for the Python programming language.} + +%description %_description + + +%package -n python3-pandas +Summary: %{summary} + +# pandas/_libs/window/aggregations.pyx: +# +# Moving maximum / minimum code taken from Bottleneck under the terms +# of its Simplified BSD license +# https://github.com/pydata/bottleneck +# +# These snippets are extracted from Bottleneck’s internals and cannot be +# replaced by calling the public Bottleneck API, so there is no reasonable path +# to unbundling. +Provides: bundled(python3dist(bottleneck)) + +# pandas/_libs/tslibs/parsing.pyx: +# +# Contains a routine, dateutil_parse(), from an unspecified version of dateutil +# +# Cannot be unbundled because the function is forked and compiled as Cython +Provides: bundled(python3dist(dateutil)) + +# pandas/_libs/src/klib/khash.h: +# +# From klib (https://github.com/attractivechaos/klib); it is not practical to +# package all of klib separately because it is designed as a copylib, and many +# of its components are not header-only. +Provides: bundled(klib-khash) = 0.2.6 + +# pandas/_libs/src/headers/portable.h: +# +# Contains several preprocessor macros from an unspecified version of MUSL libc +# +# Cannot be unbundled because the macros are not directly exposed in the libc +Provides: bundled(musl-libc) + +# pandas/_libs/tslibs/src/datetime/np_datetime.{h,c}: +# +# Derived from Numpy 1.7 +# +# Cannot be unbundled because the routines are forked. +Provides: bundled(python3dist(numpy)) = 1.7 + +# pandas/util/version/__init__.py: +# +# Vendored from https://github.com/pypa/packaging/blob/main/packaging/_structures.py +# and https://github.com/pypa/packaging/blob/main/packaging/_structures.py +# changeset ae891fd74d6dd4c6063bb04f2faeadaac6fc6313 +# 04/30/2021 +# +# Cannot be (reasonably) unbundled because the vendored file is not part of +# packaging’s public API. +Provides: bundled(python3dist(packaging)) = 20.10.dev0^20210430gitae891fd + +# pandas/io/clipboard/: +# +# In https://github.com/pandas-dev/pandas/pull/28471, upstream considered and +# rejected the idea of de-vendoring pyperclip. Furthermore, +# https://github.com/pandas-dev/pandas/commits/main/pandas/io/clipboard and +# https://github.com/pandas-dev/pandas/commits/main/pandas/io/clipboard/__init__.py +# show that the vendored library has accrued Pandas-specific changes. +# +# Version number from: +# https://github.com/pandas-dev/pandas/pull/28471/commits/33cd2d72e0c007c460e59105efda9211441b2ce4 +# “Updated internal pyperclip 1.5.27 -> 1.7.0” +Provides: bundled(python3dist(pyperclip)) = 1.7.0 + +# pandas/_libs/src/parser/tokenizer.c: +# +# Combines some elements from Python's built-in csv module and Warren +# Weckesser's textreader project on GitHub. +# +# Elements from these are both forked and cannot be unbundled. The textreader +# project is a Python extension but is not on PyPI, and is not the same as +# python3dist(textreader). +Provides: bundled(python3-libs) +Provides: bundled(textreader) + +# scripts/no_bool_in_generic.py: +# +# The function `visit` is adapted from a function by the same name in pyupgrade: +# https://github.com/asottile/pyupgrade/blob/5495a248f2165941c5d3b82ac3226ba7ad1fa59d/pyupgrade/_data.py#L70-L113 +# +# Not packaged (pre-commit hook) therefore not bundled +# Provides: bundled(python3dist(pyupgrade)) = 2.11.0^20210201git5495a24 + +# pandas/io/sas/sas7bdat.py +# +# Based on code written by Jared Hobbs: +# https://bitbucket.org/jaredhobbs/sas7bdat +# +# Cannot be unbundled because the code is modified, not directly copied +Provides: bundled(python3dist(sas7bdat)) + +# pandas/_testing/__init__.py: in _create_missing_idx(): +# +# below is cribbed from scipy.sparse +# +# Cannot be unbundled because only a few lines are copied, not a standalone +# function that we can call +Provides: bundled(python3dist(scipy)) + +# pandas/_libs/src/ujson/lib/: +# +# This is a stripped-down copy of UltraJSON. It would be an obvious target for +# unbundling, except: +# +# - Pandas uses the C library API, but UltraJSON upstream does not support +# building and installing it separately from the Python package. +# - In https://github.com/pandas-dev/pandas/issues/24711 it is suggested that +# Pandas might rely on features of the particular vendored version of +# UltraJSON. It’s not immediately clear whether this is still true or not. +Provides: bundled(python3dist(ujson)) + +# pandas/core/accessor.py +# +# Ported with modifications from xarray +# https://github.com/pydata/xarray/blob/master/xarray/core/extensions.py +# 1. We don't need to catch and re-raise AttributeErrors as RuntimeErrors +# 2. We use a UserWarning instead of a custom Warning +# +# Cannot be unbundled because the copied code is forked. +Provides: bundled(python3dist(xarray)) + +BuildRequires: gcc +BuildRequires: gcc-c++ + +BuildRequires: python3-devel + +# Runtime dependencies +BuildRequires: python3dist(numpy) >= 1.26 +BuildRequires: python3dist(python-dateutil) >= 2.8.2 +BuildRequires: python3dist(pytz) >= 2020.1 + +%if %{with tests} +# From the [test] extra +BuildRequires: python3dist(hypothesis) +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(pytest-xdist) +%endif + +%if %{without bootstrap} + +# doc/source/getting_started/install.rst “Recommended dependencies” +# Since these provide large speedups, we make them hard dependencies except +# during bootstrapping. +BuildRequires: python3dist(numexpr) >= 2.8.4 +Requires: python3dist(numexpr) >= 2.8.4 +BuildRequires: python3dist(bottleneck) >= 1.3.6 +Requires: python3dist(bottleneck) >= 1.3.6 + +# doc/source/getting_started/install.rst “Optional dependencies” +# We BR all weak dependencies to ensure they are installable. + +# Timezones +BuildRequires: tzdata >= 2022g +Recommends: tzdata >= 2022g + +# Visualization +BuildRequires: python3dist(matplotlib) >= 3.6.3 +Recommends: python3dist(matplotlib) >= 3.6.3 +BuildRequires: python3dist(jinja2) >= 3.1.2 +Recommends: python3dist(jinja2) >= 3.1.2 +BuildRequires: python3dist(tabulate) >= 0.9 +Recommends: python3dist(tabulate) >= 0.9 + +# Computation +BuildRequires: python3dist(scipy) >= 1.10 +Recommends: python3dist(scipy) >= 1.10 +# python-numba is not currently packaged: +# BuildRequires: python3dist(numba) >= 0.56.4 +# Recommends: python3dist(numba) >= 0.56.4 +BuildRequires: python3dist(xarray) >= 2022.12.0 +Recommends: python3dist(xarray) >= 2022.12.0 + +# Excel files +BuildRequires: python3dist(xlrd) >= 2.0.1 +Recommends: python3dist(xlrd) >= 2.0.1 +BuildRequires: python3dist(xlsxwriter) >= 3.0.5 +Recommends: python3dist(xlsxwriter) >= 3.0.5 +BuildRequires: python3dist(openpyxl) >= 3.1 +Recommends: python3dist(openpyxl) >= 3.1 +# python-calamine is not currently packaged: +# BuildRequires: python3dist(python-calamine) >= 0.1.7 +# Recommends: python3dist(python-calamine) >= 0.1.7 +# python-pyxlsb is not currently packaged: +# BuildRequires: python3dist(pyxlsb) >= 1.0.10 +# Recommends: python3dist(pyxlsb) >= 1.0.10 +# Not in doc/source/getting_started/install.rst, but in environment.yml and in +# some doc-strings: +BuildRequires: python3dist(odfpy) >= 1.4.1 +Recommends: python3dist(odfpy) >= 1.4.1 + +# HTML +BuildRequires: python3dist(beautifulsoup4) >= 4.11.2 +Recommends: python3dist(beautifulsoup4) >= 4.11.2 +BuildRequires: python3dist(html5lib) >= 1.1 +Recommends: python3dist(html5lib) >= 1.1 +# lxml handled below: + +# XML +BuildRequires: python3dist(lxml) >= 4.9.2 +Recommends: python3dist(lxml) >= 4.9.2 + +# SQL databases +BuildRequires: python3dist(sqlalchemy) >= 2 +Recommends: python3dist(sqlalchemy) >= 2 +BuildRequires: python3dist(psycopg2) >= 2.9.6 +Recommends: python3dist(psycopg2) >= 2.9.6 +BuildRequires: python3dist(pymysql) >= 1.0.2 +Recommends: python3dist(pymysql) >= 1.0.2 + +# Other data sources +%if 0%{?__isa_bits} != 32 +# blosc2 does not support 32-bit architectures: +BuildRequires: python3dist(tables) >= 3.8 +Recommends: python3dist(tables) >= 3.8 +%endif +# Dependencies on blosc and zlib are indirect, via PyTables, so we do not +# encode them here. Note also that the minimum blosc version in the +# documentation seems to be that of the blosc C library, not of the blosc PyPI +# package. +# python-fastparquet is not currently packaged: +# BuildRequires: python3dist(fastparquet) >= 2022.12.0 +# Recommends: python3dist(fastparquet) >= 2022.12.0 +# libarrow does not support 32-bit architectures: +%if 0%{?__isa_bits} != 32 +BuildRequires: python3dist(pyarrow) >= 10.0.1 +Recommends: python3dist(pyarrow) >= 10.0.1 +%endif +# python-pyreadstat is not currently packaged: +# BuildRequires: python3dist(pyreadstat) >= 1.2 +# Recommends: python3dist(pyreadstat) >= 1.2 + +# Access data in the cloud +BuildRequires: python3dist(fsspec) >= 2022.11 +Recommends: python3dist(fsspec) >= 2022.11 +BuildRequires: python3dist(gcsfs) >= 2022.11 +Recommends: python3dist(gcsfs) >= 2022.11 +# python-pandas-gbq is not currently packaged: +# BuildRequires: python3dist(pandas-gbq) >= 0.19 +# Recommends: python3dist(pandas-gbq) >= 0.19 +# python-s3fs is not currently packaged: +# BuildRequires: python3dist(s3fs) >= 2022.11 +# Recommends: python3dist(s3fs) >= 2022.11 + +# Clipboard +BuildRequires: python3dist(pyqt5) +Recommends: python3dist(pyqt5) +BuildRequires: python3dist(qtpy) +Recommends: python3dist(qtpy) +BuildRequires: xclip +Recommends: xclip +BuildRequires: xsel +Recommends: xsel + +# Compression +BuildRequires: python3dist(zstandard) >= 0.19 +Recommends: python3dist(zstandard) >= 0.19 + +# This is just an “ecosystem” package in the upstream documentation, but there +# is an integration test for it. This package historically had a weak +# dependency on it, but this was unnecessary. +BuildRequires: python3dist(pandas-datareader) + +%endif + +%description -n python3-pandas %_description + + +%package -n python3-pandas+test +Summary: Tests and test extras for Pandas + +# See comment above base package License tag for licensing breakdown. +License: BSD-3-Clause AND MIT + +Requires: python3-pandas%{?_isa} = %{version}-%{release} + +%if %{without bootstrap} + +# Additional BR’s and weak dependencies below are generally those that don’t +# provide enough added functionality to be weak dependencies of the library +# package, but for which there is some integration support and additional tests +# that can be enabled. + +# Additional dependencies from environment.yml: “testing” +# Those not in the “test” extra are treated as weak dependencies for the tests. +BuildRequires: python3dist(boto3) +Recommends: python3dist(boto3) +BuildRequires: python3dist(botocore) >= 1.11 +Recommends: python3dist(botocore) >= 1.11 +# Already covered by “test” extra +# BuildRequires: python3dist(hypothesis) >= 3.82 +# Recommends: python3dist(hypothesis) >= 3.82 +# python-moto is not yet packaged +# BuildRequires: python3dist(moto) +# Recommends: python3dist(moto) +BuildRequires: python3dist(flask) +Recommends: python3dist(flask) +# Already covered by “test” extra +# BuildRequires: python3dist(pytest) >= 5.0.1 +# Requires: python3dist(pytest) >= 5.0.1 +# Already covered by “test” extra +# BuildRequires: python3dist(pytest-xdist) >= 1.21 +# Requires: python3dist(pytest-xdist) >= 1.21 +BuildRequires: python3dist(pytest-asyncio) +Recommends: python3dist(pytest-asyncio) +# python-pytest-instafail is not yet packaged +# BuildRequires: python3dist(pytest-instafail) +# Recommends: python3dist(pytest-instafail) + +# Additional dependencies from environment.yml: +# “Dask and its dependencies (that dont install with dask)” +# Asks for dask-core, but we just have dask +BuildRequires: python3dist(dask) +Recommends: python3dist(dask) +BuildRequires: python3dist(toolz) >= 0.7.3 +Recommends: python3dist(toolz) >= 0.7.3 +BuildRequires: python3dist(partd) >= 0.3.10 +Recommends: python3dist(partd) >= 0.3.10 +BuildRequires: python3dist(cloudpickle) >= 0.2.1 +Recommends: python3dist(cloudpickle) >= 0.2.1 + +# Additional dependencies from environment.yml: “downstream tests” +BuildRequires: python3dist(seaborn) +Recommends: python3dist(seaborn) +BuildRequires: python3dist(statsmodels) +Recommends: python3dist(statsmodels) + +# environment.yml: Needed for downstream xarray.CFTimeIndex test +BuildRequires: python3dist(cftime) +Recommends: python3dist(cftime) + +# environment.yml: optional +BuildRequires: python3dist(ipython) >= 7.11.1 +Recommends: python3dist(ipython) >= 7.11.1 + +# pandas/tests/io/data/spss/*.sav: +# +# From Haven +Provides: bundled(R-haven) + +# pandas/tests/window/test_rolling.py: test_rolling_std_neg_sqrt() +# +# unit test from Bottleneck +# +# There is no reasonable path to unbundling a single unit test. +Provides: bundled(python3dist(bottleneck)) + +%endif + + +%description -n python3-pandas+test +These are the tests for python3-pandas. This package: + +• Provides the “pandas.tests” package +• Makes sure the “test” extra dependencies are installed +• Carries additonal weak dependencies for running the tests + + +%prep +%autosetup -n pandas-%{version} -p1 + +# Let versioneer know what version this is +echo '__version__="%{version}"' > _version_meson.py + +# Ensure Cython-generated sources are re-generated +rm -vf $(grep -rl '/\* Generated by Cython') + +# We just want to build with the numpy in Fedora: +sed -r -i '/\boldest-supported-numpy\b/d' pyproject.toml + +# We don't need the python tzdata package because we have the system tzdata package +sed -i '/tzdata>=2022.7/d' pyproject.toml + +# Unpin meson +sed -i 's/meson-python==0.13.1/meson-python>=0.13.1/' pyproject.toml +sed -i 's/meson==1.2.1/meson>=1.2.1/' pyproject.toml + +# Unpin Cython +sed -i 's/Cython==3.0.5/Cython>=3.0.5/' pyproject.toml + +%generate_buildrequires +# the build is expensive, so we don't use -w +# we list the runtime and test BuildRequires manually +%pyproject_buildrequires -R + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files pandas + + +%check +%if %{with tests} +m="${m-}${m+ and }not network" +m="${m-}${m+ and }not db" +%if %{without slow_tests} +m="${m-}${m+ and }not slow" +%endif +# Clipboard tests don’t run without a graphical session, and it’s not worth +# using xvfb-run just for them. +m="${m-}${m+ and }not clipboard" +%if %{without single_tests} +m="${m-}${m+ and }not single" +%endif + +# This test allocates a huge amount of memory (~12GB), which causes flaky OOM +# failures on some builders. It’s not worth it. +# https://github.com/pandas-dev/pandas/issues/45223#issuecomment-1250912663 +k="${k-}${k+ and }not test_bytes_exceed_2gb" + +# This test (only) expects the current working directory to be the +# site-packages directory containing the built pandas. This is not how we run +# the tests, because we don’t want to clutter the buildroot with +# testing-related hidden files and directories. We could run tests from +# %%pyproject_build_lib if this were a problem for a lot of tests, but it’s +# easier just to skip it. +k="${k-}${k+ and }not test_html_template_extends_options" + +# Those tests started failing as of 2024-04-12. Not sure why, though. +# Dask wasn't updated at the time. +# > return get(descriptor, obj, type(obj)) +# E TypeError: descriptor '__call__' for 'type' objects doesn't apply to a 'property' object +# and +# [XPASS(strict)] pyarrow doesn't support this +k="${k-}${k+ and }not test_dask" +k="${k-}${k+ and }not test_construct_dask_float_array" +k="${k-}${k+ and }not test_multi_thread_string_io_read_csv[pyarrow]" + +# Two tests started failing with matplotlib >= 3.9.0 +# E matplotlib._api.deprecation.MatplotlibDeprecationWarning: +# The plot_date function was deprecated in Matplotlib 3.9 +# and will be removed in 3.11. Use plot instead. +# +# E UserWarning: No artists with labels found to put in legend. +# Note that artists whose label start with an underscore are ignored +# when legend() is called with no argument. +k="${k-}${k+ and }not test_mpl_nopandas" +k="${k-}${k+ and }not test_plot_scatter_shape" + +%ifarch %{ix86} +# These failures are i686-specific; most are likely 32-bit issues. It’s not +# really worth trying to fix them. + +# E AssertionError: DataFrame.iloc[:, 2] (column name="C") are different +# E +# E DataFrame.iloc[:, 2] (column name="C") values are different (11.66363 %) +# E [index]: [0, 1, … +# Fails for [left], [right], [outer], and [inner] +k="${k-}${k+ and }not (TestMerge and test_int64_overflow_how_merge)" + +# E AssertionError: DataFrame.index are different +# E +# E Attribute "dtype" are different +# E [left]: int32 +# E [right]: int64 +k="${k-}${k+ and }not (TestMerge and test_int64_overflow_sort_false_order)" + +# E AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="b") are different +# E +# E Attribute "dtype" are different +# E [left]: int32 +# E [right]: int64 +k="${k-}${k+ and }not test_frame_setitem_dask_array_into_new_col" + +# E IndexError: index 0 is out of bounds for axis 0 with size 0 +k="${k-}${k+ and }not (TestPivotTable and test_pivot_number_of_levels_larger_than_int32)" +k="${k-}${k+ and }not (TestStackUnstackMultiLevel and test_unstack_number_of_levels_larger_than_int32)" + +# [XPASS(strict)] Floating point error +k="${k-}${k+ and }not (TestTimedeltas and test_to_timedelta_float)" +%endif + +%ifarch s390x +# Note that pandas does not test big-endian support but will happily accept +# patches to improve it: +# https://github.com/pandas-dev/pandas/issues/4737#issuecomment-1090931741 + +# TODO: Why does this fail? +# +# > os.fsync(self._handle.fileno()) +# E OverflowError: Python int too large to convert to C int +k="${k-}${k+ and }not test_flush" + +# TODO: Why does this fail? The differences are large! +k="${k-}${k+ and }not test_rolling_var_numerical_issues" + +# These are a cluster of similar pyarrow/parquet tests with apparent endianness +# issues. It is not immediately obvious where the bug is—in the library or in +# the tests? +k="${k-}${k+ and }not (TestBasic and test_dtype_backend[pyarrow])" +k="${k-}${k+ and }not (TestBasic and test_multiindex_with_columns)" +k="${k-}${k+ and }not (TestBasic and test_write_column_index_nonstring[pyarrow])" +k="${k-}${k+ and }not (TestBasic and test_write_column_index_string)" +k="${k-}${k+ and }not (TestBasic and test_write_column_multiindex[pyarrow])" +k="${k-}${k+ and }not (TestBasic and test_write_column_multiindex_nonstring[pyarrow])" +k="${k-}${k+ and }not (TestBasic and test_write_column_multiindex_string)" +k="${k-}${k+ and }not (TestParquetPyArrow and test_basic)" +k="${k-}${k+ and }not (TestParquetPyArrow and test_to_bytes_without_path_or_buf_provided)" +k="${k-}${k+ and }not (TestParquetPyArrow and test_categorical)" +k="${k-}${k+ and }not (TestParquetPyArrow and test_additional_extension_arrays)" +k="${k-}${k+ and }not (TestParquetPyArrow and test_pyarrow_backed_string_array[python])" +k="${k-}${k+ and }not (TestParquetPyArrow and test_pyarrow_backed_string_array[pyarrow])" +k="${k-}${k+ and }not (TestParquetPyArrow and test_additional_extension_types)" +k="${k-}${k+ and }not (TestParquetPyArrow and test_infer_string_large_string_type)" +k="${k-}${k+ and }not (TestParquetPyArrow and test_read_dtype_backend_pyarrow_config)" +k="${k-}${k+ and }not (TestParquetPyArrow and test_read_dtype_backend_pyarrow_config_index)" +k="${k-}${k+ and }not (TestParquetPyArrow and test_roundtrip_decimal)" +k="${k-}${k+ and }not test_to_read_gcs[parquet]" + +# Similarly, there are a cluster of similar stata test failures for which the +# root cause is not immediately obvious. +k="${k-}${k+ and }not (TestStata and test_writer_117)" +k="${k-}${k+ and }not (TestStata and test_convert_strl_name_swap)" +k="${k-}${k+ and }not (TestStata and test_strl_latin1)" +# Fails for [118], [119], and [None] +k="${k-}${k+ and }not (TestStata and test_utf8_writer)" + +# These crash, and are probably a blosc2 or PyTables issue. +k="${k-}${k+ and }not test_complibs[blosc2" +%endif + + +%ifarch x86_64 +# These are brittle and fail with tiny floating-point differences on COPR +# builders but not Koji builders, like: +# > raise_assert_detail(obj, msg, left, right, index_values=index_values) +# E AssertionError: numpy array are different +# E +# E numpy array values are different (16.66667 %) +# E [left]: [0.09999999999999999, 1.0, 10.0, 100.0, 1000.0, 10000.0] +# E [right]: [0.1, 1.0, 10.0, 100.0, 1000.0, 10000.0] +k="${k-}${k+ and }not (TestSeriesPlots and test_bar_log)" +k="${k-}${k+ and }not (TestDataFramePlotsSubplots and test_bar_log_no_subplots)" +k="${k-}${k+ and }not (TestDataFramePlotsSubplots and test_bar_log_subplots)" +%endif + +# Ensure pytest doesn’t find the “un-built” library. We can get away with this +# approach because the tests are also in the installed library. We can’t simply +# “cd” to the buildroot’s python3_sitearch because testing leaves files in the +# current working directory. +mkdir -p _empty +cd _empty + +# See: test_fast.sh +# Workaround for pytest-xdist flaky collection order +# https://github.com/pytest-dev/pytest/issues/920 +# https://github.com/pytest-dev/pytest/issues/1075 +export PYTHONHASHSEED="$( + %{python3} -c 'import random; print(random.randint(1, 4294967295))' +)" + +# Previously, we ran tests in parallel. Upstream seems to support this; +# however, in practice, there were still some flaky test failures that seem to +# be fixed by eschewing parallelism (-n 1). +# +# If we start running tests in parallel again in the future, note that on +# 32-bit platforms (%%if 0%%{?__isa_bits} == 32) it may be necessary to limit +# the number of concurrent tests to e.g. 8 in order to prevent memory +# exhaustion. +%pytest -v '%{buildroot}%{python3_sitearch}/pandas' \ + -o cache_dir="$PWD/pytest-cache" \ + --no-strict-data-files \ + -m "${m-}" \ + -k "${k-}" \ + -n 1 \ + -r sxX + +%else +# Some imports require optional dependencies, and must be excluded during +# bootstrapping. +%{pyproject_check_import \ + %{?with_bootstrap:-e 'pandas.io.formats.style'} \ + %{?with_bootstrap:-e 'pandas.io.formats.style_render'} \ + %{?with_bootstrap:-e 'pandas.core.arrays.arrow.extension_types'} \ + -e 'pandas.conftest' \ + -e 'pandas.tests.*'} +%endif + + +%files -n python3-pandas -f %{pyproject_files} +# While pyproject_files automatically handles the LICENSE file in the Python +# package’s dist-info directory, we also want to package the entire LICENSES/ +# directory to include third-party license text. We include a second copy of +# the LICENSE file since it would be surprising to see a license directory for +# the package without the overall license file in it. +%license LICENSE LICENSES/ +%doc README.md +%exclude %{python3_sitearch}/pandas/tests + + +%files -n python3-pandas+test +%{python3_sitearch}/pandas/tests +%ghost %{python3_sitearch}/*.dist-info + + +%changelog +* Fri Jul 19 2024 Fedora Release Engineering - 2.2.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Wed Jun 26 2024 Orion Poplawski - 2.2.1-6 +- Add upstream patch to fix tests with Python 3.13 + +* Tue Jun 18 2024 Python Maint - 2.2.1-5 +- Rebuilt for Python 3.13 + +* Sat Jun 08 2024 Python Maint - 2.2.1-4 +- Bootstrap for Python 3.13 + +* Mon May 06 2024 Sandro - 2.2.1-3 +- Stop building for i686 + +* Mon Mar 11 2024 Sandro - 2.2.1-2 +- Drop dependency on dask for i686 + +* Fri Feb 23 2024 Elliott Sales de Andrade - 2.2.1-1 +- Update to 2.2.1 + +* Mon Feb 12 2024 Elliott Sales de Andrade - 2.2.0-1 +- Update to 2.2.0 + +* Fri Feb 9 2024 Miro Hrončok - 2.1.4-1 +- Update to 2.1.4 + +* Fri Jan 26 2024 Fedora Release Engineering - 1.5.3-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 1.5.3-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jul 20 2023 Python Maint - 1.5.3-8 +- Rebuilt for Python 3.12 + +* Wed Jul 19 2023 Elliott Sales de Andrade - 1.5.3-7 +- Backport patch for Python 3.12 deprecation + +* Wed Jun 14 2023 Python Maint - 1.5.3-6 +- Bootstrap for Python 3.12 + +* Mon May 29 2023 Benjamin A. Beasley - 1.5.3-5 +- Simplify running tests serially + +* Tue May 16 2023 Benjamin A. Beasley - 1.5.3-4 +- Extend pyarrow 10/11 patch for pyarrow 12 (fix RHBZ#2207628) + +* Wed Apr 19 2023 Benjamin A. Beasley - 1.5.3-3 +- Drop unnecessary weak dependency on python-pandas-datareader +- Backport proper pyarrow 10 and 11 support + +* Thu Apr 13 2023 Benjamin A. Beasley - 1.5.3-2 +- Fix RHBZ#2171682 by backporting upstream PR#52150 + +* Mon Feb 27 2023 Benjamin A. Beasley - 1.5.3-1 +- Update to 1.5.3 (close RHBZ#2162303) + +* Fri Jan 20 2023 Fedora Release Engineering - 1.5.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sun Dec 04 2022 Benjamin A. Beasley - 1.5.2-1 +- Update to 1.5.2 +- Re-enable python-gcsfs BR/weak-dep. on F38 and later +- Work around a harmless test failure with libarrow/pyarrow 10 +- Allow a slightly older numpy version for F37 +- Skip a test that sometimes hangs on aarch64 and ppc64le +- Additional test skips for F37 +- Drop some test skips that are no longer needed +- Fix several flaky test failures by no longer running tests in parallel + +* Wed Nov 23 2022 Benjamin A. Beasley - 1.5.1-2 +- Update license breakdown and convert to SPDX +- Fully update optional dependencies and their versions +- Do not BR/Recommend pyarrow on 32-bit arches, where it is unavailable +- Drop accommodations for 32-bit ARM and Fedoras older than 36 +- Update test skips for i686 + +* Mon Nov 07 2022 Jonathan Wright - 1.5.1-1 +- Update to 1.5.1 rhbz#2014890 + +* Fri Jul 22 2022 Fedora Release Engineering - 1.3.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jun 29 2022 Python Maint - 1.3.5-3 +- Rebuilt for Python 3.11 + +* Mon Jun 13 2022 Python Maint - 1.3.5-2 +- Bootstrap for Python 3.11 + +* Sat Apr 02 2022 Benjamin A. Beasley - 1.3.5-1 +- Update to 1.3.5 +- Drop compatibility with old RHEL releases that will not get this version anyway +- Update weak dependencies from documentation +- Also package README.md +- Do not install C sources +- Carefully handle virtual Provides and licenses for bundled/copied code +- Use pyproject-rpm-macros +- Run the tests (requires switching to GitHub source) +- Minimize optional dependencies when bootstrapping + +* Fri Jan 21 2022 Fedora Release Engineering - 1.3.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Oct 07 2021 Sergio Pascual - 1.3.3-2 +- New release of pandas 1.3.3 +- Add missing sources + +* Fri Jul 23 2021 Fedora Release Engineering - 1.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jul 21 2021 Sergio Pascual - 1.3.0-1 +- New release of pandas 1.3.0 + +* Mon Jun 07 2021 Python Maint - 1.2.4-2 +- Rebuilt for Python 3.10 + +* Fri Jun 04 2021 Sergio Pascual - 1.2.4-1 +- New release of pandas 1.2.4 + +* Fri Jun 04 2021 Python Maint - 1.2.1-3 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 1.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sun Jan 24 2021 Orion Poplawski - 1.2.1-1 +- Update to 1.2.1 + +* Wed Jan 13 2021 Sergio Pascual - 1.2.0-1 +- New release of pandas 1.2.0 + +* Fri Nov 27 2020 Sergio Pascual - 1.1.4-1 +- New release of pandas 1.1.4 + +* Wed Jul 29 2020 Fedora Release Engineering - 1.0.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sun Jul 05 2020 Elliott Sales de Andrade - 1.0.5-1 +- Update to latest version + +* Mon May 25 2020 Miro Hrončok - 1.0.1-2 +- Rebuilt for Python 3.9 + +* Fri Feb 07 2020 Orion Poplawski - 1.0.1-1 +- Update to 1.0.1 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.25.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Nov 11 2019 Sergio Pascual - 0.25.3-1 +- New release of pandas 0.25.3 (python 3.8 support included) + +* Fri Sep 13 2019 Elliott Sales de Andrade - 0.25.1-2 +- Backport patch for Python 3.8 compatibility + +* Sat Aug 24 2019 Zbigniew Jędrzejewski-Szmek - 0.25.1-1 +- Update to latest version + +* Mon Aug 19 2019 Miro Hrončok - 0.24.1-5 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 0.24.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jun 27 2019 Elliott Sales de Andrade - 0.24.1-3 +- Fix doc build with numpydoc 0.9 + +* Tue Jun 18 2019 Miro Hrončok - 0.24.1-2 +- Subpackage python2-pandas has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Thu Mar 07 2019 Elliott Sales de Andrade - 0.24.1-1 +- Update to 0.24.1 + +* Sat Feb 02 2019 Fedora Release Engineering - 0.23.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Aug 21 2018 Sergio Pascual - 0.23.4-1 +- New release of pandas 0.23.4 + +* Sat Jul 14 2018 Fedora Release Engineering - 0.23.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 0.23.0-2 +- Rebuilt for Python 3.7 + +* Tue Jun 05 2018 Sergio Pascual - 0.23.0-1 +- New release of pandas 0.23.0 + +* Fri Feb 09 2018 Fedora Release Engineering - 0.22.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jan 17 2018 Sergio Pascual - 0.22.0-1 +- New release of pandas 0.22.0 + +* Tue Jan 16 2018 Troy Dawson - 0.20.3-2 +- Update conditionals + +* Sun Sep 10 2017 Sergio Pascual - 0.20.3-1 +- New upstream version (0.20.3) + +* Thu Aug 03 2017 Fedora Release Engineering - 0.20.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.20.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon May 15 2017 Sergio Pascual - 0.20.1-1 +- New upstream version (0.20.1) + +* Sat Feb 11 2017 Fedora Release Engineering - 0.19.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Jan 27 2017 Sergio Pascual - 0.19.2-1 +- New upstream version (0.19.2) + +* Mon Dec 19 2016 Miro Hrončok - 0.19.1-2 +- Rebuild for Python 3.6 + +* Wed Nov 09 2016 Sergio Pascual - 0.19.1-1 +- New upstream version (0.19.1) + +* Wed Oct 19 2016 Sergio Pascual - 0.19.0-1 +- New upstream version (0.19.0) +- Brings pandas-datareader using recommends + +* Sat Oct 15 2016 Peter Robinson - 0.18.1-3 +- rebuilt for matplotlib-2.0.0 + +* Tue Jul 19 2016 Fedora Release Engineering - 0.18.1-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Wed Jul 13 2016 Sergio Pascual - 0.18.1-1 +- New upstream version (0.18.1) +- Update pypi url + +* Sat Apr 09 2016 Igor Gnatenko - 0.18.0-3 +- Fix broken deps + +* Sat Apr 09 2016 Igor Gnatenko - 0.18.0-2 +- Fix python_provide macros usage (FTBFS for some packages) + +* Wed Mar 30 2016 Sergio Pascual - 0.18.0-1 +- New upstream version (0.18.0) + +* Thu Feb 04 2016 Fedora Release Engineering - 0.17.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Sun Jan 03 2016 Sergio Pascual - 0.17.1-1 +- New upstream version (0.17.1) +- Add new dependecy as weak dep (fixes bz #1288919) + +* Tue Nov 10 2015 Fedora Release Engineering - 0.17.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 + +* Wed Oct 28 2015 Orion Poplawski - 0.17.0-2 +- Use common build directory, new python macros +- Filter provides +- Fix provides + +* Mon Oct 12 2015 Sergio Pascual - 0.17.0-1 +- New release of pandas 0.17.0 + +* Thu Jun 18 2015 Fedora Release Engineering - 0.16.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Jun 15 2015 Sergio Pascual - 0.16.2-1 +- New release of pandas 0.16.2 + +* Mon May 18 2015 Sergio Pascual - 0.16.1-1 +- New release of pandas 0.16.1 + +* Sat May 02 2015 Kalev Lember - 0.16.0-2 +- Rebuilt for GCC 5 C++11 ABI change + +* Tue Mar 24 2015 Sergio Pascual - 0.16.0-1 +- New release of pandas 0.16.0 +- Use license macro +- Don't use py3dir (new python guidelines) + +* Tue Jan 20 2015 Sergio Pascual - 0.15.2-3 +- Pandas actually supports dateutil 2 + +* Mon Jan 19 2015 Sergio Pascual - 0.15.2-2 +- Update dependency on dateutil to dateutil15 (bz #1183368) + +* Wed Dec 17 2014 Sergio Pascual - 0.15.2-1 +- New release of pandas 0.15.2 + +* Thu Nov 20 2014 Sergio Pascual - 0.15.1-1 +- New release of pandas 0.15.1 + +* Mon Oct 20 2014 Sergio Pascual - 0.15.0-1 +- New release of pandas 0.15.0 + +* Sun Aug 17 2014 Fedora Release Engineering - 0.14.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sun Jul 13 2014 Sergio Pascual - 0.14.1-1 +- New release of pandas 0.14.1 + +* Mon Jun 16 2014 Sergio Pascual - 0.14.0-1 +- New release of pandas 0.14.0 + +* Sat Jun 07 2014 Fedora Release Engineering - 0.12.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed May 14 2014 Bohuslav Kabrda - 0.12.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + +* Tue Jan 28 2014 Sergio Pascual - 0.12.0-4 +- Enable python3 build +- Set CFLAGS before build + +* Fri Dec 13 2013 Kushal Das 0.12.0-3 +- Fixed dependency name + +* Fri Dec 06 2013 Pierre-Yves Chibon fr - 0.12.0-2 +- Change BR from python-setuptools-devel to python-setuptools + See https://fedoraproject.org/wiki/Changes/Remove_Python-setuptools-devel + +* Fri Sep 20 2013 Kushal Das 0.12.0-1 +- New release of pandas 0.12.0 + +* Sun Aug 04 2013 Fedora Release Engineering - 0.10.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 0.10.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Dec 24 2012 Kushal Das 0.10.0-1 +- New release of pandas 0.10.0 + +* Thu Nov 08 2012 Kushal Das 0.10.0-1 +- New release of pandas 0.10.0 + +* Thu Nov 08 2012 Kushal Das 0.9-1 +- New release of pandas + +* Fri Aug 03 2012 Kushal Das 0.8.1-2 +- Fixes from review request + +* Tue Jul 10 2012 Kushal Das 0.8.1-1 +- Initial release in Fedora