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

pkgname=python-hpack
pkgver=4.1.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=('8720b30e65ce48b2d085699d172b14d362f19e9d85aab20c6bed47a3665f2f371e09e093f9cca58e443d735a54765596a32daf918cc121624b5c2f209b62d457')

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/
}
