# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-pycountry
_pkgname=pycountry
pkgver=22.3.5
pkgrel=2
pkgdesc="ISO country, subdivision, language, currency and script definitions and their translations"
url="https://pypi.org/project/pycountry"
arch="noarch"
license="LGPL-2.1-only"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-country py-pycountry" # Backwards compatibility
provides="py-country=$pkgver-r$pkgrel py-pycountry=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$builddir/src" pytest-3
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
07dc507ee94f1880727761df197f81704386d9246163c9a5872f47083d37c7d1205dfbd28c6663ef0731a0b05277ade03a1a1929ab84087e0e85c05028c68b89  pycountry-22.3.5.tar.gz
"
