# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Antonio Rojas <arojas@archlinux.org>

_pyname=comm
pkgname=python-$_pyname
pkgver=0.2.2
pkgrel=2
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=(python-build
             python-hatchling
             python-installer)
checkdepends=(python-pytest)
source=(https://github.com/ipython/$_pyname/archive/v$pkgver/$_pyname-$pkgver.tar.gz)
sha256sums=('68c38c96d73dd10c18bdf3e398bee497b084fc50c43848fd4803043262dfca30')

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

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

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