# 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.4
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=(
  'git'
  '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=("git+https://github.com/pallets/werkzeug.git#tag=${pkgver}")
sha512sums=('b8522aafa0d3dc6d02842229f738290381ed1707d75c9c20311f90f0bec4dc35b35390d5efd847137a9c6493cc06d4d4511795bf168ef542cc92ab81a142e102')

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

check() {
  cd werkzeug
  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
  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:
