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

_pyname=hatch-jupyter-builder
pkgname=python-$_pyname
pkgver=0.9.1
pkgrel=5
pkgdesc='A hatch plugin to help build Jupyter packages'
arch=(any)
url='https://jupyter.org/'
license=(BSD-3-Clause)
depends=(python
         python-hatchling
         python-packaging)
makedepends=(git
             python-build
             python-installer)
checkdepends=(python-pytest
              python-pytest-mock)
source=(git+https://github.com/jupyterlab/hatch-jupyter-builder#tag=v$pkgver)
sha256sums=('ad1d12e0619c72338e59be001fd2065fa25557a4a551fb41dff3f12c949c1f67')

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

check() {
  cd $_pyname
  pytest -v
}

package() {
  cd $_pyname
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname
}
