# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=hypercorn
pkgver=0.16.0
pkgrel=1
pkgdesc='An ASGI Server based on Hyper libraries and inspired by Gunicorn'
url=https://github.com/pgjones/hypercorn
arch=(any)
license=(MIT)
depends=(
  python-h11
  python-h2
  python-priority
  python-toml
  python-typing_extensions
  python-wsproto
)
makedepends=(
  git
  python-build
  python-installer
  python-poetry-core
)
checkdepends=(
  python-distlib
  python-hypothesis
  python-pytest
  python-pytest-asyncio
  python-pytest-sugar
  python-pytest-trio
  python-tox
  python-trio
)
optdepends=('python-trio: trio support')
_tag=f8e4e5de3aec7f8eb986535163c3d5b4f424465c
source=(git+https://github.com/pgjones/hypercorn.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd hypercorn
  git describe --tags
}

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

check() {
  cd hypercorn
  tox -e py311
}

package() {
  python -m installer --destdir="${pkgdir}" hypercorn/dist/*.whl
  install -Dm 644 hypercorn/LICENSE -t "${pkgdir}"/usr/share/licenses/hypercorn/
}

# vim: ts=2 sw=2 et:
