# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgname=python-inflate64
_pyname=${pkgname#python-}
pkgver=1.0.4
pkgrel=1
pkgdesc='decompression of deflate64, enhanced deflate and compression algorithm'
arch=(x86_64)
url="https://codeberg.org/miurahr/${_pyname}"
license=(LGPL)
depends=(python)
makedepends=(python-{build,installer,wheel}
             python-setuptools-scm)
checkdepends=(python-pytest)
_archive="$_pyname-$pkgver"
source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.tar.gz")
sha256sums=('b398c686960c029777afc0ed281a86f66adb956cfc3fbf6667cc6453f7b407ce')

build(){
	cd "$_archive"
	python -m build -wn
}

check() {
	cd "$_archive"
	local _pyver=cpython-$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
	export PYTHONPATH="$PWD/build/lib.linux-$CARCH-$_pyver"
	python -m pytest tests
}

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