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

pkgname=python-h2
pkgver=4.3.0
pkgrel=1
pkgdesc="HTTP/2 State-Machine based protocol implementation"
arch=('any')
license=('MIT')
url="https://hyper.rtfd.org"
depends=('python-hpack' 'python-hyperframe')
makedepends=('git' 'python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest' 'python-hypothesis')
source=("git+https://github.com/python-hyper/h2.git#tag=v$pkgver")
sha512sums=('8d2ae5ec4b96cc60def583cc879f40717e611df1520fea01c1912f2b1bfd457b8c794e7c0708d365fa77348cea30eb8591352f3c27135d2d4a5c243c727695f4')

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

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

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