# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-django-scopes
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=django-scopes
pkgver=2.0.0
pkgrel=1
pkgdesc="Scope querys in multi-tenant django applications"
url="https://pypi.python.org/project/django-scopes"
arch="noarch"
license="Apache-2.0"
depends="py3-django"
checkdepends="py3-pytest-django"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="$pkgname-$pkgver.tar.gz::https://github.com/raphaelm/django-scopes/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"

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
	DJANGO_SETTINGS_MODULE=tests.settings .testenv/bin/python3 -m pytest -v
}

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

sha512sums="
0d341e2fd0186af2dfe294eb750fadd91be6b543a8e4f566c9cbd033bdfff93ec684cb5f053132059ca5afde22707fdc55f0d6a8de616841073f7465fc2dcc8a  py3-django-scopes-2.0.0.tar.gz
"
