# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-cachecontrol
_realname=cachecontrol
pkgver=0.14.1
pkgrel=0
pkgdesc="httplib2 caching for requests"
url="https://github.com/psf/cachecontrol"
arch="noarch"
license="Apache-2.0"
depends="
	py3-msgpack
	py3-requests
	"
makedepends="
	py3-flit-core
	py3-gpep517
	"
checkdepends="
	py3-cherrypy
	py3-filelock
	py3-lockfile
	py3-mock
	py3-pytest-xdist
	py3-redis
	"
subpackages="$pkgname-pyc"
source="https://github.com/psf/cachecontrol/archive/refs/tags/v$pkgver/py3-cachecontrol-$pkgver.tar.gz"
builddir="$srcdir/$_realname-$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 -n auto
}

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

sha512sums="
620db2833659b9d6b3b2a45179ed715ed23d2a887cf642049925cb2834cb89415d824c3e0ef1ccef0bd1767d3e7a4115fb4855c093ac3c749ba105c071df9a34  py3-cachecontrol-0.14.1.tar.gz
"
