# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-ciso8601
pkgver=2.3.1
pkgrel=1
pkgdesc="Fast ISO8601 date time parser for Python written in C"
url="https://github.com/closeio/ciso8601"
license="MIT"
arch="all"
makedepends="python3-dev py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-tz"
source="https://github.com/closeio/ciso8601/archive/v$pkgver/py3-ciso8601-$pkgver.tar.gz"
builddir="$srcdir/ciso8601-$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="
cf01355ffb197d8fe10c336d78e370bdf508f9a58cf2b9e912ae4d7da80910387eaf8809e3c6ccf12891b915708111bb155a0e2bb3de8a7e95f74284be9256a8  py3-ciso8601-2.3.1.tar.gz
"
