Blame python-dask.spec

325cfc4
%global srcname dask
325cfc4
325cfc4
# Requires distributed, which is a loop.
f882b41
# Also, some tests require packages that require dask itself.
325cfc4
# Force bootstrap for package review.
418969d
%bcond_without bootstrap
325cfc4
e5d1690
# We have an arched package to detect arch-dependent issues in dependencies,
e5d1690
# but all of the installable RPMs are noarch and there is no compiled code.
e5d1690
%global debug_package %{nil}
e5d1690
325cfc4
Name:           python-%{srcname}
b566f18
Version:        2024.1.1
b566f18
%global tag     2024.1.1
3212fae
Release:        %autorelease
325cfc4
Summary:        Parallel PyData with Task Scheduling
325cfc4
c90f00f
License:        BSD-3-Clause
12974de
URL:            https://github.com/dask/dask
7e84e06
Source0:        %{pypi_source %{srcname}}
fef2284
# https://github.com/dask/dask/issues/6725
7e84e06
Patch:          0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
7cd18b9
# Fedora-specific patch.
7cd18b9
Patch:          0002-Skip-coverage-testing.patch
b17de15
# Drop after dropping 32-bit support.
b17de15
Patch:          0003-TST-Increase-maximum-for-sizeof-test-to-pass-32-bit.patch
c5e584e
# https://github.com/dask/dask/pull/10451
c5e584e
Patch:          0004-Fix-test_pandas_timestamp_overflow_pyarrow-condition.patch
9934e1a
# https://github.com/dask/dask/issues/10423
9934e1a
Patch:          https://salsa.debian.org/python-team/packages/dask/-/raw/08ffea1b7b53e9c71c9a926d5786288c2e6c1b5b/debian/patches/force-little-endian-random.patch
cd8020f
Patch:          0005-Allow-older-versioneer.patch
7f30dda
# Ignore warnings from Pandas.
7f30dda
# Upstream had https://github.com/dask/dask/pull/10307 but reverted it because
7f30dda
# a new Pandas was released that fixed the warning, but we don't have it yet.
2b65f28
Patch:          0006-Ignore-NumPy-warnings-from-Pandas.patch
325cfc4
325cfc4
%description
325cfc4
Dask is a flexible parallel computing library for analytics.
325cfc4
325cfc4
325cfc4
%package -n     python3-%{srcname}
325cfc4
Summary:        %{summary}
325cfc4
e5d1690
BuildArch:      noarch
e5d1690
325cfc4
BuildRequires:  python3-devel
325cfc4
BuildRequires:  python3dist(graphviz)
325cfc4
BuildRequires:  python3dist(ipython)
c3b3086
%if %{without bootstrap}
f882b41
BuildRequires:  python3dist(scikit-image)
f882b41
BuildRequires:  python3dist(xarray)
325cfc4
%endif
f882b41
# Optional test requirements.
e5d1690
# Fastavro does not support 32 bit architectures and is ExcludeArch:
e5d1690
# https://bugzilla.redhat.com/show_bug.cgi?id=1943932
e5d1690
%ifnarch %{arm32} %{ix86}
f882b41
BuildRequires:  python3dist(fastavro)
e5d1690
%endif
f882b41
BuildRequires:  python3dist(h5py)
f882b41
BuildRequires:  python3dist(psutil)
c9cdc4a
# libarrow does not support 32 bit architectures and is ExcludeArch.
c9cdc4a
# Tests don't pass on s390x either.
c9cdc4a
%ifnarch %{arm} %{ix86} s390x
4055809
BuildRequires:  python3dist(pyarrow)
4055809
%endif
f882b41
BuildRequires:  python3dist(requests)
f882b41
BuildRequires:  python3dist(sqlalchemy)
38f2f4e
# tables does not support 32 bit architectures and is ExcludeArch.
38f2f4e
%ifnarch %{ix86}
4055809
BuildRequires:  python3dist(tables)
38f2f4e
%endif
f882b41
BuildRequires:  python3dist(zarr)
325cfc4
0e49bd2
Recommends:     python3-%{srcname}+array = %{version}-%{release}
0e49bd2
Recommends:     python3-%{srcname}+bag = %{version}-%{release}
0e49bd2
Recommends:     python3-%{srcname}+dataframe = %{version}-%{release}
0e49bd2
Recommends:     python3-%{srcname}+delayed = %{version}-%{release}
45461af
%if %{without bootstrap}
0e49bd2
Recommends:     python3-%{srcname}+distributed = %{version}-%{release}
45461af
%endif
7e84e06
# No recent enough Bokeh is packaged
7e84e06
Obsoletes:      python3-%{srcname}+diagnostics < 2022.5.0-1
7e84e06
7e84e06
# There is nothing that can be unbundled; there are some some snippets forked
c90f00f
# or copied from unspecified versions of numpy, under a BSD-3-Clause license
c90f00f
# similar to that of dask itself.
7e84e06
#
7e84e06
# - dask/array/numpy_compat.py:
7e84e06
#     _Recurser, moveaxis, rollaxis, sliding_window_view
7e84e06
# - dask/array/backends.py:
7e84e06
#     _tensordot
7e84e06
# - dask/array/core.py:
7e84e06
#     block
7e84e06
# - dask/array/einsumfuncs.py:
7e84e06
#     parse_einsum_input
7e84e06
# - dask/array/routines.py:
7e84e06
#     cov, _average
7e84e06
Provides:       bundled(numpy)
0e49bd2
0e49bd2
%description -n python3-%{srcname}
0e49bd2
Dask is a flexible parallel computing library for analytics.
0e49bd2
0e49bd2
7e84e06
%pyproject_extras_subpkg -n python3-%{srcname} array bag dataframe delayed
45461af
%if %{without bootstrap}
5c5b983
%pyproject_extras_subpkg distributed
45461af
%endif
325cfc4
325cfc4
c3b3086
%if %{without bootstrap}
325cfc4
%package -n python-%{srcname}-doc
325cfc4
Summary:        dask documentation
325cfc4
e5d1690
BuildArch:      noarch
e5d1690
44b63c5
BuildRequires:  python3dist(dask_sphinx_theme) >= 1.3.5
325cfc4
BuildRequires:  python3dist(numpydoc)
5c5b983
BuildRequires:  python3dist(sphinx) >= 4
325cfc4
325cfc4
%description -n python-%{srcname}-doc
de9725c
Documentation for dask.
325cfc4
%endif
325cfc4
325cfc4
325cfc4
%prep
7e84e06
%autosetup -n %{srcname}-%{version} -p1
5cdcaef
# we don't use pre-commit when running tests
5cdcaef
sed -i '/"pre-commit"/d' setup.py
325cfc4
5c5b983
5c5b983
%generate_buildrequires
7e84e06
%pyproject_buildrequires -r -x test,array,bag,dataframe,delayed
5c5b983
%if %{without bootstrap}
5c5b983
%pyproject_buildrequires -x distributed
5c5b983
%endif
5c5b983
325cfc4
325cfc4
%build
5c5b983
%pyproject_wheel
325cfc4
c3b3086
%if %{without bootstrap}
325cfc4
# generate html docs
325cfc4
PYTHONPATH=${PWD} sphinx-build-3 docs/source html
325cfc4
# remove the sphinx-build leftovers
325cfc4
rm -rf html/.{doctrees,buildinfo}
325cfc4
%endif
325cfc4
325cfc4
325cfc4
%install
5c5b983
%pyproject_install
5c5b983
5c5b983
%pyproject_save_files %{srcname}
325cfc4
325cfc4
325cfc4
%check
de9725c
%ifarch arm
de9725c
# Is there a way to do this in one line?
de9725c
%global have_arm 1
f882b41
%endif
325cfc4
0020ae6
%if 0%{?__isa_bits} == 32
7e84e06
# read_sql_query with meta converts dtypes from 32 to 64.
7e84e06
# https://github.com/dask/dask/issues/8620
7e84e06
7e84e06
# >           tm.assert_frame_equal(
7e84e06
#                 a, b, check_names=check_names, check_dtype=check_dtype, **kwargs
7e84e06
# E               AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="age") are different
7e84e06
# E
7e84e06
# E               Attribute "dtype" are different
7e84e06
# E               [left]:  int32
7e84e06
# E               [right]: int64
7e84e06
# dask/dataframe/utils.py:555: AssertionError
7e84e06
k="${k-}${k+ and }not test_query_with_meta"
7e84e06
%endif
7e84e06
7e84e06
%ifarch ppc64le
7e84e06
# TODO: Should this be reported upstream? Is it a dask issue, or a numpy one?
7e84e06
# Possibly related to
7e84e06
# https://fedoraproject.org/wiki/Changes/PPC64LE_Float128_Transition?
7e84e06
7e84e06
# >           assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
7e84e06
# E           AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
7e84e06
# E           assert False
7e84e06
# E            +  where False = allclose(array([0.12586355-0.09957204j, 0.20256483+0.04098342j,\n       0.05781123-0.03588671j, 0.01135963-0.03334219j,\n       0.03747771+0.07495994j, 0.2106574 -0.0363521j ,\n       0.16352091+0.03782915j, 0.1381678 -0.06815128j,\n       0.03781295-0.04011523j, 0.01493269+0.07780643j]), array([0.12559072-0.07164038j, 0.20256483+0.05438578j,\n       0.05781123-0.03588671j, 0.01135963-0.03334219j,\n       0.03747771+0.07495994j, 0.2106574 -0.0363521j ,\n       0.16352091+0.03782915j, 0.1381678 -0.06815128j,\n       0.03781295-0.04011523j, 0.01493269+0.07780643j]), equal_nan=True, **{})
7e84e06
# dask/array/utils.py:361: AssertionError
7e84e06
k="${k-}${k+ and }not test_lstsq[100-10-10-True]"
7e84e06
# >           assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
7e84e06
# E           AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
7e84e06
# E           assert False
7e84e06
# E            +  where False = allclose(array([ 0.20168675+0.08857556j,  0.144233  -0.19173091j,\n       -0.03367557-0.08053959j,  0.04108325-0.24648308j,\n       -0.01844576+0.00841932j,  0.29652375+0.05682199j,\n        0.05551828+0.20156798j, -0.08409592+0.02354949j,\n        0.09848743-0.00748637j,  0.22889193-0.07372773j]), array([ 0.20067551+0.2642591j ,  0.144233  -0.18573336j,\n       -0.03367557-0.08053959j,  0.04108325-0.24648308j,\n       -0.01844576+0.00841932j,  0.29652375+0.05682199j,\n        0.05551828+0.20156798j, -0.08409592+0.02354949j,\n        0.09848743-0.00748637j,  0.22889193-0.07372773j]), equal_nan=True, **{})
7e84e06
# dask/array/utils.py:361: AssertionError
7e84e06
k="${k-}${k+ and }not test_lstsq[20-10-5-True]"
7e84e06
7e84e06
# test_vdot fails with NumPy 1.19.0
7e84e06
# https://github.com/dask/dask/issues/6406
7e84e06
#
7e84e06
# vdot returns incorrect results on ppc64le
7e84e06
# https://github.com/numpy/numpy/issues/17087
7e84e06
7e84e06
# >           assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
7e84e06
# E           AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
7e84e06
# E           assert False
7e84e06
# E            +  where False = allclose((0.38772781971416226-0.6851997484294434j), (0.38772781971416226-0.306563166009585j), equal_nan=True, **{})
7e84e06
# dask/array/utils.py:361: AssertionError
7e84e06
k="${k-}${k+ and }not test_vdot[shape0-chunks0]"
7e84e06
# >           assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
7e84e06
# E           AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
7e84e06
# E           assert False
7e84e06
# E            +  where False = allclose((0.38772781971416226-0.6851997484294434j), (0.38772781971416226-0.306563166009585j), equal_nan=True, **{})
7e84e06
# dask/array/utils.py:361: AssertionError
7e84e06
k="${k-}${k+ and }not test_vdot[shape1-chunks1]"
7e84e06
%endif
7e84e06
7e84e06
# This test compares against files in .github/. It does not work on the PyPI
7e84e06
# sdist, and is only relevant to upstream CI anyway.
7e84e06
#
7e84e06
# test_development_guidelines_matches_ci fails from sdist
7e84e06
# https://github.com/dask/dask/issues/8499
7e84e06
k="${k-}${k+ and }not test_development_guidelines_matches_ci"
7e84e06
ac0268d
# This test shows excess memory usage on Python 3.12
ac0268d
# https://github.com/dask/dask/issues/10418
ac0268d
k="${k-}${k+ and }not test_division_or_partition"
ac0268d
de9725c
pytest_args=(
de9725c
  -m 'not network'
de9725c
de9725c
  -n %[0%{?have_arm}?"2":"auto"]
29dda8a
b52704b
%ifarch %{ix86}
b52704b
  # Ignore 32-bit warning
b52704b
  -W 'ignore:invalid value encountered in cast:RuntimeWarning'
b52704b
%endif
e5d1690
e5d1690
  -k "${k-}"
c90f00f
c90f00f
  --pyargs dask
de9725c
)
de9725c
c90f00f
cd docs
de9725c
%{pytest} "${pytest_args[@]}"
325cfc4
5c5b983
%files -n python3-%{srcname} -f %{pyproject_files}
325cfc4
%doc README.rst
7e84e06
%license LICENSE.txt dask/array/NUMPY_LICENSE.txt
6d3b28d
%{_bindir}/dask
0e49bd2
c3b3086
%if %{without bootstrap}
325cfc4
%files -n python-%{srcname}-doc
325cfc4
%doc html
7e84e06
%license LICENSE.txt dask/array/NUMPY_LICENSE.txt
325cfc4
%endif
325cfc4
325cfc4
325cfc4
%changelog
3212fae
%autochangelog