# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-pathable
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=pathable
pkgver=0.4.4
pkgrel=0
pkgdesc="Object-oriented JSONSchema"
url="https://github.com/p1c2u/pathable"
arch="noarch"
license="Apache-2.0"
checkdepends="
	py3-pytest
	py3-pytest-cov
"
makedepends="
	poetry
	py3-setuptools
	py3-gpep517
	py3-wheel
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/p1c2u/pathable/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

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 "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

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

sha512sums="
4b1ec32f7e952749ec0384036e7becf5343e92cbec9160627c2a678e314d7387bd4ad56a3953171038a38102c715469e973218cb3995df414bd9dd750986e046  py3-pathable-0.4.4.tar.gz
"
