# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-tz
pkgver=2024.2
pkgrel=0
pkgdesc="Python3 definitions of world timezone"
url="https://pythonhosted.org/pytz/"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/p/pytz/pytz-$pkgver.tar.gz"
builddir="$srcdir/pytz-$pkgver"

replaces="py-tz" # Backwards compatibility
provides="py-tz=$pkgver-r$pkgrel" # 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
	cd pytz/tests
	../../.testenv/bin/python3 test_tzinfo.py
}

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

sha512sums="
140a34f51044188420ac3bfbaa5ece91ea0fe4faf7a247c01312265b63b4aa8d2b389219234e173eca0343d0463aef9d6472ee803915ead989594896567c593e  pytz-2024.2.tar.gz
"
