# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-mako
_pkgname=Mako
pkgver=1.3.6
pkgrel=0
pkgdesc="Python3 fast templating language"
url="https://www.makotemplates.org/"
arch="noarch"
license="MIT"
depends="python3 py3-markupsafe"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-babel py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/M/Mako/mako-$pkgver.tar.gz"
builddir="$srcdir"/mako-$pkgver

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

# secfixes:
#   1.2.2-r0:
#     - CVE-2022-40023

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
	# unpackaged py3-lingua
	.testenv/bin/python3 -m pytest --ignore test/ext/test_linguaplugin.py
}

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

sha512sums="
ad7a05b7cb4a330495ba5842d578565356d19912fee20e2d894a6e5a7812197944943d947eb15a539ef4a11d2bafde29fc7b007767228bd8e40f154d53631073  mako-1.3.6.tar.gz
"
