# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Dan Serban
# Contributor: Richard Murri

pkgname=python-werkzeug
pkgver=3.1.3
pkgrel=1
pkgdesc='Swiss Army knife of Python web development'
url='https://werkzeug.palletsprojects.com/'
arch=('any')
license=('BSD-3-Clause')
depends=(
  'python'
  'python-markupsafe'
)
makedepends=(
  'python-build'
  'python-flit-core'
  'python-installer'
)
checkdepends=(
  'python-cryptography'
  'python-ephemeral-port-reserve'
  'python-greenlet'
  'python-pytest'
  'python-pytest-timeout'
  'python-pytest-xprocess'
  'python-requests'
  'python-watchdog'
)
optdepends=('python-watchdog: faster and more advanced reloader')
source=("https://github.com/pallets/werkzeug/archive/${pkgver}/$pkgname-$pkgver.tar.gz")
sha512sums=('07b64f9c8a36a82df1dc70689f76d64f8ae4776e59ca91d53b327607f6a1896bc81a242cd4f85ef755ea6e7aeada4cb596c25ff9fe409ad3c9221c0fb13c4cdb')

build() {
  cd "werkzeug-$pkgver"
  python -m build --wheel --no-isolation
}

check() {
  cd "werkzeug-$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 "werkzeug-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname"
}

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