# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=py3-roman
_pkgname=roman
pkgver=4.1
pkgrel=1
pkgdesc="Integer to Roman numerals converter"
url="https://pypi.org/project/roman"
arch="noarch"
license="ZPL-2.1"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-roman" # Backwards compatibility
provides="py-roman=$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 src/tests.py
}

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

sha512sums="
69214f35098e17bd106411036feec8a4e5c8450e394c74d60a8e3cc17c6884556347a1d2852fa174db4f66d969e71b26c066439afd6d278786d1a47bf925f302  roman-4.1.tar.gz
"
