# Contributor: Noel Kuntze <noel.kuntze@thermi.consulting>
# Maintainer: Noel Kuntze <noel.kuntze@thermi.consulting>
pkgname=py3-inline-snapshot
pkgver=0.14.1
pkgrel=0
pkgdesc="Create and update inline snapshots in your python tests"
url="https://github.com/15r10nk/inline-snapshot"
arch="noarch"
license="MIT"
depends="
	black
	py3-asttokens
	py3-click
	py3-executing
	py3-rich
	py3-tomli
	py3-typing-extensions"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-setuptools
	py3-wheel"
#py3-time-machine
checkdepends="
	py3-dirty-equals
	py3-hypothesis
	py3-mypy
	py3-pydantic
	py3-pytest-freezer
	py3-pytest-mock
	py3-pytest-subtests
	py3-pytest-xdist"
subpackages="$pkgname-pyc"

source="$pkgname-$pkgver.tar.gz::https://github.com/15r10nk/inline-snapshot/archive/v$pkgver.tar.gz"

builddir="$srcdir/inline-snapshot-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
	python3 -m installer -d test_dir dist/*.whl
	export PYTHONPATH="$PWD/test_dir/$_site_packages:$PYTHONPATH"
	pytest -vv --deselect tests/test_typing.py tests/
}

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

sha512sums="
d1440854aafb5d784666f6a2e3d614240e80cbdb082095672ea303cb5ac1560e47a0cb218745b831305fa2915e851f40405b619a4a51de14c55645b97d1c7db2  py3-inline-snapshot-0.14.1.tar.gz
"
