# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Contributor: Eivind Uggedal <eivind@uggedal.com>
# Maintainer: Steven Guikal <void@fluix.one>
pkgname=py3-flask-wtf
_pkgname=flask_wtf
pkgver=1.2.2
pkgrel=0
pkgdesc="Flask WTForms extension"
url="https://pypi.org/project/Flask-WTF"
arch="noarch"
license="BSD-3-Clause"
depends="python3 py3-flask py3-wtforms"
makedepends="py3-gpep517 py3-hatchling"
checkdepends="py3-pytest py3-wtforms-lang"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-flask-wtf" # Backwards compatibility
provides="py-flask-wtf=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
6f06de7cd8dc1676011457f40c0d0f288d49808e272fd6b5e07c6ef352e807290c7898feff37a249e5d2e83ea320259f63043629dc42d52d52d5ec5116ed6c85  flask_wtf-1.2.2.tar.gz
"
