# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=py3-executing
pkgver=2.1.0
pkgrel=0
pkgdesc="Get information about what a Python frame is currently doing"
url="https://github.com/alexmojaki/executing"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools_scm py3-wheel"
checkdepends="ipython py3-asttokens py3-littleutils py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/alexmojaki/executing/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/executing-$pkgver"
options="!check" # circular dependency: ipython -> py3-stack_data -> itself

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	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() {
	local whl=.dist/executing-$pkgver-py2.py3-none-any.whl
	python3 -m installer --destdir="$pkgdir" "$whl"
}

sha512sums="
0918ed3eca37d55a1c19b20a959538c46d65688979e0808270b7060a25d3db44bb593d2f8de202740af9f008f273e1e7565ba5b20b90c678e070b52a12bed4cd  py3-executing-2.1.0.tar.gz
"
