# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>

_pyname=jupyter_client
pkgname=python-${_pyname/_/-}
pkgver=8.6.1
pkgrel=1
pkgdesc='Jupyter protocol implementation and client libraries'
arch=(any)
url='https://pypi.python.org/pypi/jupyter_client'
license=(BSD-3-Clause)
depends=(ipython
         python
         python-dateutil
         python-importlib-metadata
         python-ipykernel
         python-jupyter-core
         python-pexpect
         python-pyzmq
         python-tornado
         python-traitlets)
makedepends=(python-build
             python-hatchling
             python-installer)
checkdepends=(iproute2
              net-tools
              openssh
              python-pytest-jupyter
              python-pytest-timeout)
conflicts=(python-jupyter_client)
provides=(python-jupyter_client)
replaces=(python-jupyter_client)
source=(https://files.pythonhosted.org/packages/source/j/jupyter_client/jupyter_client-$pkgver.tar.gz)
sha256sums=('e842515e2bab8e19186d89fdfea7abd15e39dd581f94e399f00e2af5a1652d3f')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pyname-$pkgver
  pytest -v -W ignore::ResourceWarning
}

package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
