# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-vcrpy
pkgver=6.0.1
pkgrel=1
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="
b5802b661335a7941d7e60e0a623799000eecfef53d4522ea31051bc543a0b1cb089d5a33e27642fd2bbde3dc85f5217dfba4ad6da8f76e2e7ceae5d900d26c6  vcrpy-6.0.1.tar.gz
"
