# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
_pkgname=geopy
pkgname="py3-$_pkgname"
pkgver=2.4.1
pkgrel=1
pkgdesc="Geocoding library"
url="https://geopy.readthedocs.io/"
arch="noarch"
license="MIT"
depends="
	py3-geographiclib
	"
makedepends="
	py3-gpep517
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="
	py3-async_generator
	py3-aiohttp
	py3-pytest
	py3-pytest-aiohttp
	py3-pytest-asyncio
	py3-pytest-xdist
	py3-sphinx
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/g/geopy/geopy-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$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 -n auto -v \
		--ignore='test/geocoders' \
		--deselect=test/adapters/each_adapter.py # timeout read internet
}

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

sha512sums="
d64a0fe218e2306afabf7f5e981441012a7958b99ed66a141166f272d27c8f239cdfbe4b01ec6c5ea0d0a979a0c612b3d40638bb7e1c9f0d9c4bc1f402ca96cb  geopy-2.4.1.tar.gz
"
