Blob Blame History Raw
%global srcname dask

# Requires distributed, which is a loop.
# Also, some tests require packages that require dask itself.
# Force bootstrap for package review.
%bcond_without bootstrap

Name:           python-%{srcname}
Version:        2021.9.0
Release:        %autorelease
Summary:        Parallel PyData with Task Scheduling

License:        BSD
Source0:        %pypi_source
Patch0001:      0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
Patch0002:      0002-fix-index_col-duplication-if-index_col-is-type-str.patch

BuildArch:      noarch

Dask is a flexible parallel computing library for analytics.

%package -n     python3-%{srcname}
Summary:        %{summary}

BuildRequires:  python3-devel
BuildRequires:  python3dist(graphviz)
BuildRequires:  python3dist(ipython)
%if %{without bootstrap}
BuildRequires:  python3dist(scikit-image)
BuildRequires:  python3dist(xarray)
# Optional test requirements.
BuildRequires:  python3dist(fastavro)
BuildRequires:  python3dist(h5py)
BuildRequires:  python3dist(psutil)
BuildRequires:  python3dist(requests)
BuildRequires:  python3dist(sqlalchemy)
BuildRequires:  python3dist(zarr)

Recommends:     python3-%{srcname}+array = %{version}-%{release}
Recommends:     python3-%{srcname}+bag = %{version}-%{release}
Recommends:     python3-%{srcname}+dataframe = %{version}-%{release}
Recommends:     python3-%{srcname}+delayed = %{version}-%{release}
Recommends:     python3-%{srcname}+diagnostics = %{version}-%{release}
%if %{without bootstrap}
Recommends:     python3-%{srcname}+distributed = %{version}-%{release}

%description -n python3-%{srcname}
Dask is a flexible parallel computing library for analytics.

%pyproject_extras_subpkg -n python3-%{srcname} array bag dataframe delayed diagnostics
%if %{without bootstrap}
%pyproject_extras_subpkg distributed

%if %{without bootstrap}
%package -n python-%{srcname}-doc
Summary:        dask documentation

BuildRequires:  python3dist(dask_sphinx_theme) >= 1.3.5
BuildRequires:  python3dist(numpydoc)
BuildRequires:  python3dist(sphinx) >= 4

%description -n python-%{srcname}-doc
Documentation for dask.

%autosetup -n %{srcname}-%{version} -p1

%pyproject_buildrequires -r -x test,array,bag,dataframe,delayed,diagnostics
%if %{without bootstrap}
%pyproject_buildrequires -x distributed


%if %{without bootstrap}
# generate html docs
PYTHONPATH=${PWD} sphinx-build-3 docs/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}


%pyproject_save_files %{srcname}

%ifarch arm
# Is there a way to do this in one line?
%global have_arm 1

  -m 'not network'


  -n %[0%{?have_arm}?"2":"auto"]

%{pytest} "${pytest_args[@]}"

%files -n python3-%{srcname} -f %{pyproject_files}
%doc README.rst
%license LICENSE.txt

%if %{without bootstrap}
%files -n python-%{srcname}-doc
%doc html
%license LICENSE.txt