# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=distributed
pkgname=python-${_pkg}
pkgver=2023.8.0
pkgrel=1
pkgdesc="Distributed task scheduler for Dask"
arch=(x86_64 aarch64)
url="https://distributed.dask.org/"
license=(BSD)
depends=(
    python
    python-click
    python-cloudpickle
    python-dask
    python-jinja
    python-msgpack
    python-packaging
    python-psutil
    python-sortedcontainers
    python-tblib
    python-toolz
    python-tornado
    python-urllib3
    python-yaml
    python-zict
)
makedepends=(python-setuptools python-versioneer)
checkdepends=(ipython
    python-pytest
    python-pytest-repeat
    python-pytest-timeout
    python-flaky
    python-blosc
    python-cryptography
    python-distributed
    python-fsspec
    python-h5py
    python-ipykernel
    python-ipywidgets
    python-jsonschema
    python-locket
    python-lz4
    python-netcdf4
    python-numpy
    python-pandas
    python-paramiko
    python-prometheus_client
    python-pyarrow
    python-pytorch
    python-requests
    python-scipy
    python-snappy
    python-zstandard
)
# No tests in PyPi tarballs
#source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
source=(https://github.com/dask/distributed/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('7733597772ce4680939095ec425e4bce97049a7386472ef3416f6a929cb81150')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

# Not collecting properly, no time to investigate
#check() {
#  cd ${_pkg}-${pkgver}
#  pytest -vvrsfE --color=yes distributed -m "not avoid_ci"
#}

package() {
  cd ${_pkg}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm644 LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
