# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-snapshottest
pkgver=0.6.0
pkgrel=5
pkgdesc="Snapshot testing for pytest, unittest, Django, and Nose"
url="https://github.com/syrusakbary/snapshottest"
arch="noarch"
license="MIT"
depends="
	py3-fastdiff
	py3-termcolor
	python3
	"
makedepends="py3-setuptools py3-gpep517"
checkdepends="
	py3-django
	py3-nose
	py3-pytest
	py3-pytest-cov
	py3-six
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/s/snapshottest/snapshottest-$pkgver.tar.gz
	importlib.patch
	"
builddir="$srcdir/snapshottest-$pkgver"

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

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest --ignore tests/test_pytest.py
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
0f39ec0b2255291d35bcc873b73b3802b427efd53b8d12ab373a76193dfe9d108534980f8081be38fadbf2392915e8e0d63547e5bf0479ea06d8d79cde4016ce  snapshottest-0.6.0.tar.gz
2ee20d34f7db1a736401d0b217576dad1b308bb69b578a17123cfeab3e363c0cfc0348e321c2f299f01324997034230c61ed3eba6145da1f726f64474d5aa39a  importlib.patch
"
