# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-django-auth-ldap
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=django-auth-ldap
pkgver=5.1.0
pkgrel=0
pkgdesc="Django LDAP authentication backend"
url="https://pypi.python.org/project/django-auth-ldap"
# s390x: test failure
arch="noarch !s390x"
license="BSD"
depends="py3-django py3-ldap"
checkdepends="
	py3-pytest
	py3-pytest-django
	py3-pytest-black
	py3-isort
	py3-flake8
	openldap
	openldap-back-mdb
	openldap-clients
	openldap-overlay-syncprov
	"
makedepends="py3-setuptools_scm py3-gpep517 py3-wheel"
source="$pkgname-$pkgver.tar.gz::https://github.com/django-auth-ldap/django-auth-ldap/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"

build() {
	SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver 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
	TMP=/tmp .testenv/bin/python3 -Wa -b -m django test --settings tests.settings
}

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

sha512sums="
e79840b74c966d9c1cb66e283f9495ca4e0954f5aa62f76c181c63096f9d006b93d810523ef7741e9957649ae4a9f78da35c2a3fb5106617d63985f819b62cd6  py3-django-auth-ldap-5.1.0.tar.gz
"
