# Contributor: Thomas Boerger <thomas@webhippie.de>
# Maintainer: Thomas Boerger <thomas@webhippie.de>
pkgname=py3-humanize
_pkgname=humanize
pkgver=4.9.0
pkgrel=1
pkgdesc="Python humanize functions"
options="!check" # No tests are actually run
url="https://pypi.org/project/humanize"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-hatchling py3-hatch-vcs"
checkdepends="py3-mock py3-freezegun py3-pytest"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/python-humanize/humanize/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces=py-humanize # Backwards compatibility
provides=py-humanize=$pkgver-r$pkgrel # Backwards compatibility

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m pytest
}

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

sha512sums="
f52cf97ac1e3546b78c9652293ac519ffa4dd449040df31974d8274e4246cc91faf25c2de5a8d4da50d617f15ed082193a4af0bd9044d187f726b8f1192b277c  humanize-4.9.0.tar.gz
"
