# Maintainer: Antonio Rojas <arojas@archlinux.org>

_pyname=comm
pkgname=python-$_pyname
pkgver=0.2.3
pkgrel=1
pkgdesc='Python Comm implementation for the Jupyter kernel protocol'
arch=(any)
url='https://pypi.org/project/comm/'
license=(BSD-3-Clause)
depends=(python
         python-traitlets)
makedepends=(git
             python-build
             python-hatchling
             python-installer)
checkdepends=(python-pytest)
source=(git+https://github.com/ipython/$_pyname#tag=v$pkgver)
sha256sums=('940e51d2c3564ef4e9f485430efd009344d2075d622896a9700fd7b048b57593')

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

check() {
  cd $_pyname
  PYTHONPATH="$PWD" \
  pytest -v
}

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