# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-whoosh
_pyname="Whoosh"
pkgver=2.7.4
pkgrel=2
arch="noarch"
pkgdesc="Fast, pure-Python full text indexing, search, and spell checking library"
url="https://pypi.python.org/project/whoosh"
license="BSD-3-Clause"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-pytest-runner
	"
source="
	$pkgname-$pkgver.tar.gz::https://pypi.io/packages/source/W/Whoosh/Whoosh-$pkgver.tar.gz
	test-fix.patch
	"
builddir="$srcdir"/$_pyname-$pkgver
subpackages="$pkgname-pyc"

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
	# test_minimize_dfa: AssertionError: assert <whoosh.automata.fsa.DFA object at 0x7fe398473ad0> == <whoosh.automata.fsa.DFA object at 0x7fe3984706e0>
	.testenv/bin/python3 -m pytest -v -k 'not test_minimize_dfa'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}
sha512sums="
7cdefdcf52b704ffe50c00718c42677e2ddfe879f81ad2d14b580b0e026cc0ebb6b9ddc99d8709eaff4eb9b83f654b042c8792821e1ed90aa85cfa6f82845074  py3-whoosh-2.7.4.tar.gz
191254eb455bc8bf762e0ae05c43cf3dc18ca948a824a8285a0337127d887655998f82a8f5ed807942c0ad14ac78c7c9e3b0742413bc3b19ee949bbd9dbd6e6c  test-fix.patch
"
