# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-hpack
pkgver=4.2.0
pkgrel=1
pkgdesc="Pure-Python HPACK header compression"
arch=('any')
url="https://hyper.rtfd.org/"
license=('MIT')
depends=('python')
makedepends=('git' 'python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest' 'python-hypothesis')
source=("git+https://github.com/python-hyper/hpack.git#tag=v$pkgver")
sha512sums=('01b6b0a2d41bd429724d88dc9fa46119cd6512ab1b891bb202b7bc1e4e2969f369018ba66c07f2cfc6f6f5f73f878807ecab5ec403c0c677bf82a69caaa5b69d')

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

check() {
  cd hpack
  PYTHONPATH="$PWD/src" pytest
}

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