# Contributor: Lauren N. Liberda <lauren@selfisekai.rocks>
# Maintainer: Lauren N. Liberda <lauren@selfisekai.rocks>
pkgname=py3-pylru
pkgver=1.2.1
pkgrel=1
pkgdesc="Least recently used (LRU) cache for Python"
url="https://github.com/jlhutch/pylru"
arch="noarch"
license="GPL-2.0-or-later"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/jlhutch/pylru/archive/refs/tags/v$pkgver/pylru-$pkgver.tar.gz"
builddir="$srcdir/pylru-$pkgver"
options="!check" # no tests

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
}

sha512sums="
930a017431229cd02967e0aeb2ca8f456900e0bc90063b873e4d880fd52d4216d64da60220a5863984d3f9a8f6a6fcd6bad575fb2a0df45071e839cffcb0a5ba  pylru-1.2.1.tar.gz
"
