# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-vcrpy
pkgver=7.0.0
pkgrel=0
pkgdesc="Automatically mock your HTTP interactions to simplify and speed up testing"
options="!check" # Tests fail on the builders
url="https://github.com/kevin1024/vcrpy"
arch="noarch"
license="MIT"
depends="py3-yarl py3-yaml py3-wrapt"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-httpbin"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/v/vcrpy/vcrpy-$pkgver.tar.gz"
builddir="$srcdir/vcrpy-$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
	# ssl errors when test_requests.py is run
	.testenv/bin/python3 -m pytest --deselect=tests/integration/test_requests.py
}

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

sha512sums="
5849872120e6a9383dbc5f3184a83c36effde3b00ece59d3954be3356d7f1740ea6e8b7baf2da7e840418036dedd086bfe9f245157a5b9919cbb1502db4afdb0  vcrpy-7.0.0.tar.gz
"
