# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-django-hatchway
pkgver=0.5.2
pkgrel=2
pkgdesc="Django API framework inspired by FastAPI"
url="https://pypi.org/project/django-hatchway/"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-django
	py3-pydantic
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest-django"
subpackages="$pkgname-pyc"
source="https://github.com/andrewgodwin/django-hatchway/archive/$pkgver/py3-django-hatchway-$pkgver.tar.gz
	pydantic-v1.patch
	"
builddir="$srcdir/django-hatchway-$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
}

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

sha512sums="
f94703c4a8eedc51c8a7e8070fdc386c095f7a3b951c84f57730c9964fb95743e1d25d344e999caa3736785f51b626593a34258cf0220ae12ee8c158d843f526  py3-django-hatchway-0.5.2.tar.gz
2c59fa9b656b78a9d8c89b0a7a41258f5eaede05e2ac599339c2545228c1b6f4766cb137624eaf5c3bf61501c9a8a901eb3532caf08111ca537876354f08eff5  pydantic-v1.patch
"
