# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Simon Sapin <simon dot sapin at exyr dot org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=python-h11
pkgver=0.14.0
pkgrel=4
pkgdesc="A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
url="https://github.com/python-hyper/h11"
license=('MIT')
arch=(any)
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools')
checkdepends=('python-pytest')
source=("git+https://github.com/python-hyper/h11.git#tag=v$pkgver")
sha512sums=('03286e989f9af9e1fd5b05ae5cd0a6f528d07ff9151d486932ccfa855a083972e1a0ee6ded9072674e447203a3cc60a0bda253b46946e42886344795586485e3')

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

check() {
  cd h11
  pytest
}

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