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

pkgname=python-hpack
pkgver=4.0.0
pkgrel=5
pkgdesc="Pure-Python HPACK header compression"
arch=('any')
url="https://hyper.rtfd.org/"
license=('MIT')
depends=('python')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest' 'python-hypothesis')
source=("https://github.com/python-hyper/hpack/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('f482d086d7a82649393e3cfea55c98966ce57055cb1826bc4dec1ea334661c02708e7903f2e8e588ee1c30df41373e1de9fb960c2e7bbc18d0ace0b8f97b195b')

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

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

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