# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-swagger-spec-validator
_pyname=swagger-spec-validator
pkgver=3.0.4
pkgrel=3
pkgdesc="Validation of Swagger specifications"
url="https://pypi.python.org/project/swagger-spec-validator"
arch="noarch"
license="Apache-2.0"
depends="
	py3-jsonschema
	py3-yaml
	py3-typing-extensions
	py3-importlib-resources
	"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-pytest
"
source="$pkgname-$pkgver-gh.tar.gz::https://github.com/Yelp/swagger_spec_validator/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/swagger_spec_validator-$pkgver
subpackages="$pkgname-pyc"

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
	# test_raise_SwaggerValidationError_on_urlopen_error: urlopen error [Errno -5] Name has no usable address>', URLError(gaierror(-5, 'Name has no usable address'
	.testenv/bin/python3 -m pytest -v -k 'not test_raise_SwaggerValidationError_on_urlopen_error'
}

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

sha512sums="
d5e74b14e8800b0ca20be9dc5095ea24c26dcb0720d960d6686cd3687e49e359a8d08cc8595ecb1377dbc79f1f28b299485a1e9d0233b51639d5bf3e3c39c6cc  py3-swagger-spec-validator-3.0.4-gh.tar.gz
"
