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

pkgname=python-quart
pkgver=0.20.0
pkgrel=1
pkgdesc='A Python ASGI web microframework with the same API as Flask'
url=https://github.com/pallets/quart
arch=(any)
license=(MIT)
depends=(
  hypercorn
  python
  python-aiofiles
  python-blinker
  python-click
  python-flask
  python-importlib-metadata
  python-itsdangerous
  python-jinja
  python-markupsafe
  python-werkzeug
)
makedepends=(
  git
  python-build
  python-flit-core
  python-installer
  python-wheel
)
checkdepends=(
  python-dotenv
  python-hypothesis
  python-pytest
  python-pytest-asyncio
)
optdepends=('python-dotenv: support for .env files')
_tag=22aa3859884ee3d670c68e48d1945bc65af51a1a
source=(git+https://github.com/pallets/quart.git#tag=${_tag})
sha256sums=('3995aecbf78b1a8ee25bc1c2c086cd971c599e31b5114d69ef4404fb3a50b3fa')

prepare() {
  sed 's/name = "Quart"/name = "quart"/' -i quart/pyproject.toml
}

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

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

check() {
  cd quart
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest --override-ini="addopts="
}

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

# vim: ts=2 sw=2 et:
