# Contributor: Sascha Brawer <sascha@brawer.ch>
# Maintainer: Sascha Brawer <sascha@brawer.ch>
pkgname=py3-ufonormalizer
_pyname=ufonormalizer
pkgver=0.6.1
pkgrel=3
pkgdesc="Normalize the XML and other data inside UFO font design sources"
url="https://github.com/unified-font-object/ufoNormalizer"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-setuptools_scm py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/u/$_pyname/$_pyname-$pkgver.zip"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	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="
301bef368a7d42333d885437322991d075e5ebb7169e3397e1d2a486ae18d4efba4db625bad1f9452f512e0a452ec8a9fd0b5c716c8571eb45f9d4d2718f37a7  ufonormalizer-0.6.1.zip
"
