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

pkgname=python-wsproto
pkgver=1.3.2
pkgrel=1
pkgdesc="WebSockets state-machine based protocol implementation"
url="https://github.com/python-hyper/wsproto"
license=('MIT')
arch=('any')
depends=('python-h11')
makedepends=('git' 'python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest')
source=("git+https://github.com/python-hyper/wsproto.git#tag=$pkgver")
sha512sums=('fac906f8234e9e0af5157ffa02dffd94b6c335b293bd96a397ee8348f18baf5f6400eee89e57fa0c70f2b7716a3500b70102488039f6ad7ee887a96e285e33c1')

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

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

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