# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-num2words
pkgver=0.5.13
pkgrel=1
pkgdesc="Modules to convert numbers to words"
url="https://github.com/savoirfairelinux/num2words"
arch="noarch"
license="LGPL-2.1-or-later"
depends="
	py3-delegator
	py3-docopt
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/n/num2words/num2words-$pkgver.tar.gz"
#options="!check" # Broken tests
builddir="$srcdir/num2words-$pkgver"

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
	# tests/test_cli.py is broken
	.testenv/bin/python3 -m pytest \
		--deselect tests/test_cli.py
}

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

sha512sums="
bd3efb77e95d51ae373d49ba2bc552ea8eada4b1ce8706da10afcdf91c1adef5f94ae861ac7c4f758b9f0ec62004930709c262f541aa2605f636805fbf1d4b3e  num2words-0.5.13.tar.gz
"
