# Contributor: Oliver Smith <ollieparanoid@postmarketos.org>
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=txt2tags
pkgver=3.9
pkgrel=2
pkgdesc="Text formatting and conversion tool"
url="https://www.txt2tags.org"
arch="noarch"
license="GPL-2.0-or-later"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-tox bash"
subpackages="$pkgname-pyc"
source="txt2tags-$pkgver.tar.gz::https://github.com/txt2tags/txt2tags/archive/$pkgver.tar.gz"

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 tox --sitepackages -e py3
}

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

sha512sums="
f2a1b0a671049595f12a05ca68acd860002bde9b8510eb9379ad9bdf94026b30522d670d39f2beffafa50104b44b2a3394aa090297ef92b46837c9a8e7e728ea  txt2tags-3.9.tar.gz
"
