# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-catalogue
pkgver=2.0.10
pkgrel=1
pkgdesc="Super lightweight function registries for your library"
url="https://github.com/explosion/catalogue"
arch="noarch"
license="MIT"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pydantic py3-pytest py3-srsly"
subpackages="$pkgname-doc $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/explosion/catalogue/archive/v$pkgver.tar.gz"

builddir=$srcdir/catalogue-$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
	.testenv/bin/python3 -m pytest
}

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

	rm -r "$pkgdir"/usr/lib/python3*/site-packages/catalogue/_importlib_metadata/
	rm -r "$pkgdir"/usr/lib/python3*/site-packages/catalogue/tests/

	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}

sha512sums="
2181e5485f398c0db68534f04e77d198753f1f5c543c28432865f954ffa1181f786cf1ba498ab9db8d22268f1847fe047a66617b0ed1868fc13db34f694528a8  py3-catalogue-2.0.10.tar.gz
"
