# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-iso8601
pkgver=2.1.0
pkgrel=1
pkgdesc="Simple module to parse ISO 8601 dates"
url="https://github.com/micktwomey/pyiso8601"
license="MIT"
arch="noarch"
depends="python3"
makedepends="py3-gpep517 py3-poetry-core"
checkdepends="py3-pytest py3-hypothesis py3-tz"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/i/iso8601/iso8601-$pkgver.tar.gz"
builddir="$srcdir/iso8601-$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 --verbose iso8601
}

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

sha512sums="
db57ab2a25ef91e3bc479c8539d27e853cf1fbf60986820b8999ae15d7e566425a1e0cfba47d0f3b23aa703db0576db368e6c110ba2a2f46c9a34e8ee3611fb7  iso8601-2.1.0.tar.gz
"
