# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-django-timezone-field
_pkgname=django-timezone-field
pkgver=7.1
pkgrel=0
pkgdesc="Django app providing database and form fields for pytz timezone objects"
url="https://pypi.org/project/django-timezone-field"
arch="noarch"
license="BSD-2-Clause"
depends="py3-django"
makedepends="
	py3-gpep517
	py3-poetry-core
	"
checkdepends="
	py3-django-rest-framework
	py3-pytest
	py3-pytest-django
	py3-tz
	tzdata
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mfogel/$_pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver
options="!check" #fails with funcargs error, likely lazy_fixture incompatibility in test suite

replaces="py-django-timezone-field" # Backwards compatibility
provides="py-django-timezone-field=$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
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
e242ccebccb3942b2b681e87ebeb4546f925d270b705fa9049a350640c3888c2a9388339c5be9909645b0fa772a4dd71199450639f9fbe2cce531fa6a9bd0df0  py3-django-timezone-field-7.1.tar.gz
"
