# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=py3-pure_eval
pkgver=0.2.3
pkgrel=0
pkgdesc="safely evaluate AST nodes without side effects"
url="https://github.com/alexmojaki/pure_eval"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel py3-setuptools_scm"
checkdepends="py3-pytest py3-typeguard"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/alexmojaki/pure_eval/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/pure_eval-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	pytest
}

package() {
	local whl=.dist/pure_eval-$pkgver-py3-none-any.whl
	python3 -m installer --dest="$pkgdir" "$whl"
}

sha512sums="
6de7650f45cb4179a8639da41e44dcda0e01628802824e01614406c825b0617b80dfd4b2439f85fcbc6c2487164e6ed41f48394e09e448aece749adc65bf8e93  py3-pure_eval-0.2.3.tar.gz
"
