# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-rpds-py
pkgver=0.25.1
pkgrel=0
pkgdesc="Python bindings to the Rust Persistent Data Structures (rpds) crate"
url="https://github.com/crate-py/rpds"
arch="all"
license="MIT"
makedepends="
	cargo
	py3-gpep517
	py3-maturin
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/crate-py/rpds/releases/download/v$pkgver/rpds_py-$pkgver.tar.gz"
builddir="$srcdir/rpds_py-$pkgver"
options="net" # Required to download Rust crates

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--config-json '{"build-args": "--frozen"}' \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
f628e36848ec247de6c9df2c5b620137842853bae0f2d2552269552822d0a1f811d531d9b61768f7e89cbe99de8e5d637912ad680d29b1f95704114bac453591  rpds_py-0.25.1.tar.gz
"
