# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=py3-ufolib2
pkgver=0.17.1
pkgrel=0
pkgdesc="UFO font library"
url="https://github.com/fonttools/ufoLib2"
arch="noarch"
license="Apache-2.0"
depends="
	py3-attrs
	py3-fonttools
	py3-fs
	"
makedepends="
	py3-gpep517
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="
	py3-cattrs
	py3-msgpack
	py3-orjson
	py3-pytest-cov
	py3-pytest-forked
	py3-pytest-xdist
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/fonttools/ufoLib2/archive/v$pkgver.tar.gz"
builddir="$srcdir/ufoLib2-$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 -n auto --forked
}

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

sha512sums="
8db37f5c17d98b430e26dc1a250c79ebb3d12cd05175af2ade3b4691c37919b9cc9e0741624403c7907fffd84b3a3c45a400226d65c2af54e9911ed37659b74c  py3-ufolib2-0.17.1.tar.gz
"
