# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-arxiv
_pkgorig=arxiv.py
pkgver=2.1.3
pkgrel=0
pkgdesc="Python wrapper for the arXiv API"
url="https://github.com/lukasschwab/arxiv.py"
arch="noarch"
license="MIT"
depends="python3 py3-feedparser py3-requests"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest-xdist py3-flake8"
subpackages="$pkgname-pyc"
source="https://github.com/lukasschwab/arxiv.py/archive/$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"
# test domain 503's, uses net instead of a mock server
options="!check"

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
}

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

sha512sums="
2fd7c2813c5aceb9b68003bab03dc6bc2da8d04b7c79265f5567eee4f146a53dc13be5883d1df0670d8a1becbeede24551afda3158297dce95870d3e8ab69807  arxiv.py-2.1.3.tar.gz
"
