# Contributor: Bart Ribbers <bribbers@disroot.org>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-portalocker
pkgver=3.0.0
pkgrel=0
pkgdesc="An extended version of portalocker to lock files in Python using the with statement"
url="http://portalocker.readthedocs.io/en/latest/"
arch="noarch"
license="PSF-2.0"
depends="
	py3-babel
	py3-imagesize
	py3-requests
	py3-snowballstemmer
	python3
	"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	py3-sphinx
	"
checkdepends="
	py3-docutils
	py3-pytest
	py3-pytest-cov
	py3-pytest-timeout
	py3-redis
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/p/portalocker/portalocker-$pkgver.tar.gz"
builddir="$srcdir/portalocker-$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 -v
}

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

sha512sums="
7e6a31fbe536e35183598cd54c6684db4f224eb1eea64c6715bd7b5fe2562c338226dbbab94c2f4f20fb8a5ca48568ba938f60dd5b4d36ddbc186aef368fd6ad  portalocker-3.0.0.tar.gz
"
