# 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.16.0
pkgrel=1
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=('d9e97903d8501d09f9524eaa09cded304eaeb41d1afaa69124eefc87c2409ffa546b32914f25bd63687c56e1577d55802fcb1d2f991b0108bb527d28b789af62')

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