# Maintainer: fossdd <fossdd@pwned.life>
pkgname=py3-diskcache
pkgver=5.6.3
pkgrel=2
pkgdesc="disk caching implementation"
url="https://grantjenks.com/docs/diskcache/"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-pytest py3-pytest-xdist py3-mock py3-django"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/grantjenks/python-diskcache/archive/v$pkgver.tar.gz"
builddir="$srcdir"/python-diskcache-$pkgver
options="!check" # test_incr_update_keyerror fails

replaces="py-diskcache" # Backwards compatibility
provides="py-diskcache=$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
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
476d677d88212aa3f9a6e8d12c3e7076cc6a06973d703ed0b2c550b4b4e916b24fb7d8f33c7174854015886fab26e2707b134328d2bc3e144aef5510e7bc0f7c  py3-diskcache-5.6.3.tar.gz
"
