# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-warcio
pkgver=1.7.5
pkgrel=0
pkgdesc="Streaming WARC/ARC library for fast web archive IO"
url="https://github.com/webrecorder/warcio"
arch="noarch"
license="Apache-2.0"
# tests known to be broken due to missing file(s) in distribution tarball
# https://github.com/webrecorder/warcio/issues/132
options="!check"
depends="py3-six"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="
	py3-pytest
	py3-pytest-cov
	py3-pytest-httpbin
	py3-requests
	py3-wsgiprox
	"
subpackages="$pkgname-pyc"
source="py3-warcio-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/w/warcio/warcio-$pkgver.tar.gz"
builddir="$srcdir/warcio-$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 \
		--doctest-modules ./warcio --cov warcio -v test/
}

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

sha512sums="
c586de80ee3628288b4d49c5b56f5c56fd8b2e57c5cfb045764171e6c2361cfd83490b08f153316f9508dd303b7364fc0ad33bd462bfec743f32a8e9d502be05  py3-warcio-1.7.5.tar.gz
"
