# Template file for 'python3-rencode'
pkgname=python3-rencode
version=1.0.8
revision=2
build_style=python3-pep517
hostmakedepends="python3-poetry-core python3-setuptools python3-Cython"
makedepends="python3-devel"
depends="python3"
short_desc="Python3 module for fast (basic) object serialization"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="https://github.com/aresch/rencode"
distfiles="${homepage}/archive/v${version}.tar.gz"
checksum=480aab74948a7f339b749b5c39bdb4caf15429f4b49a998c770d5f371098d351

do_build() {
	pyproject-build --no-isolation --wheel .
}

do_check() {
	local testdir="${wrksrc}/.xbps-testdir/$(date +%s)"
	python3 -m installer --destdir "${testdir}" dist/*.whl

	PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
		python3 tests/test_rencode.py
}
