# Contributor: Daiki Maekawa <daikimaekawa29@gmail.com>
# Maintainer: Daiki Maekawa <daikimaekawa29@gmail.com>
pkgname=py3-frozendict
_pkgname=frozendict
pkgver=2.4.6
pkgrel=0
pkgdesc="immutable dictionary"
url="https://github.com/Marco-Sulla/python-frozendict"
arch="all"
license="LGPL-3.0-or-later"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-frozendict" # Backwards compatibility
provides="py-frozendict=$pkgver-r$pkgrel" # Backwards compatibility

# C extension lacks py311 support
export FROZENDICT_PURE_PY=1

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
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
3e6d1b530bbad65ea6a38645a3222d722e06e27eb65d19f903f4f434c7aa48d7522040ebc19035f73b4545761ce84a72b5d812c839ec199a5446f8c4d94354b4  frozendict-2.4.6.tar.gz
"
