# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-distro
_pkgname=distro
pkgver=1.9.0
pkgrel=2
pkgdesc="A Linux OS platform information API"
options="!check" # Some tests fail
url="https://github.com/python-distro/distro"
arch="noarch"
license="Apache-2.0"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-cov"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces=py-distro # Backwards compatibility
provides=py-distro=$pkgver-r$pkgrel # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m pytest
}

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

sha512sums="
dc66cb7e968e7a651c7a84681e2a0539d196073f71cf0ae1e49c5a6cd6deec345523259a8810ffdc7b6e9763a536eb388a2886ba2bbd1cb62165b57fbefb82ae  distro-1.9.0.tar.gz
"
