python-dask/python-dask.spec
2022-01-29 03:02:13 -05:00

140 lines
3.4 KiB
RPMSpec

%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: 2022.1.1
%global tag 2022.01.1
Release: %autorelease
Summary: Parallel PyData with Task Scheduling
License: BSD
URL: https://github.com/dask/dask/
Source0: https://github.com/dask/dask/archive/%{tag}/%{srcname}-%{tag}.tar.gz
# Grab this from the sdist until we switch back to it.
Source1: _version.py
# https://github.com/dask/dask/issues/6725
Patch0001: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
BuildArch: noarch
%description
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)
%endif
# 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}
%endif
%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
%endif
%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.
%endif
%prep
%autosetup -n %{srcname}-%{tag} -p1
cp %SOURCE1 %{srcname}/
%generate_buildrequires
%pyproject_buildrequires -r -x test,array,bag,dataframe,delayed,diagnostics
%if %{without bootstrap}
%pyproject_buildrequires -x distributed
%endif
%build
%pyproject_wheel
%if %{without bootstrap}
# generate html docs
PYTHONPATH=${PWD} sphinx-build-3 docs/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%endif
%install
%pyproject_install
%pyproject_save_files %{srcname}
%check
%ifarch arm
# Is there a way to do this in one line?
%global have_arm 1
%endif
pytest_args=(
-m 'not network'
# https://bugzilla.redhat.com/show_bug.cgi?id=1968947#c4
--deselect=dask/dataframe/io/tests/test_sql.py::test_select_from_select
-n %[0%{?have_arm}?"2":"auto"]
# Ignore https://github.com/numpy/numpy/issues/20225 and Pandas issues
-W ignore::DeprecationWarning
)
%{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
%endif
%changelog
%autochangelog