# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=py3-arrow
pkgver=1.3.0
pkgrel=2
pkgdesc="Python3 library to create and manipulate dates, times, and timestamps"
url="https://arrow.readthedocs.io/"
arch="noarch"
license="Apache-2.0"
depends="py3-dateutil"
makedepends="py3-flit-core py3-gpep517"
checkdepends="
	py3-pytest-cov
	py3-pytest-mock
	py3-simplejson
	py3-tz
	tzdata
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/a/arrow/arrow-$pkgver.tar.gz"
builddir="$srcdir/arrow-$pkgver"

replaces="py-arrow" # for backwards compatibility
provides="py-arrow=$pkgver-r$pkgrel" # for 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="
f0725e75d1005e0177bb234b3d2523aaf9e882ec08b020f6b3737a3af27af3c8c031aee9dcba0332595845a09a0286d56662b77ddad8a6da928ba37201725239  arrow-1.3.0.tar.gz
"
