# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Tarmo Heiskanen <turskii@gmail.com>

pkgname=python-flask
pkgver=3.1.2
pkgrel=1
pkgdesc='Micro webdevelopment framework for Python'
url='https://flask.palletsprojects.com/'
arch=('any')
license=('BSD-3-Clause')
depends=(
  'python'
  'python-blinker'
  'python-click'
  'python-itsdangerous'
  'python-jinja'
  'python-markupsafe'
  'python-werkzeug'
)
makedepends=(
  'python-build'
  'python-flit-core'
  'python-installer'
  'python-wheel'
)
checkdepends=(
  'python-asgiref'
  'python-pytest'
)
optdepends=(
  'python-asgiref: async functions and views'
  'python-cryptography: using ad-hoc certificates'
  'python-dotenv: loading env vars from files'
)
source=("$pkgname-$pkgver.tar.gz::https://github.com/pallets/flask/archive/$pkgver.tar.gz")
sha512sums=('87fcb2c73531eca0151286204034e433130f74ae365e62600f3973fbd0f11d0cdead62b07a9f4cbaaca2a1b2c149063be091c00addeba1f9ba6b7f2f2e0572c2')

build() {
  cd ${pkgname#python-}-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd ${pkgname#python-}-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest
}

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

# vim:set ts=2 sw=2 et:
