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

_pyname=comm
pkgname=python-$_pyname
pkgver=0.2.2
pkgrel=3
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=('9eec12102a5b647a0d4285ebd297f88e226a6d3c7876b7e4061a739c74793b61')

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
}
