# Contributor: Philipp Glaum <p@pglaum.de>
# Maintainer: Philipp Glaum <p@pglaum.de>
pkgname=py3-guessit
pkgver=3.8.0
pkgrel=1
pkgdesc="Library for guessing information from video filenames"
url="https://pypi.org/project/guessit/"
arch="noarch"
license="LGPL-3.0-only"
depends="
	python3
	py3-rebulk
	py3-babelfish
	py3-dateutil
	py3-six
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest-benchmark
	py3-pytest-mock
	py3-pytest-xdist
	py3-yaml
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/g/guessit/guessit-$pkgver.tar.gz"
builddir="$srcdir/guessit-$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
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto -W ignore::DeprecationWarning
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -rf "$pkgdir"/usr/lib/python3*/site-packages/guessit/test
}

sha512sums="
968e8f27dd41dcaece27444cd5117990726ef73467cedbc008dcf0fe2d1f2010209253e2fa6d645e30d9eaffe613080f1c2d77bda772227c1e6e04910d58f7ad  guessit-3.8.0.tar.gz
"
