# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=py3-setproctitle
_pkgname=setproctitle
pkgver=1.3.5
pkgrel=0
pkgdesc="A Python module to customize the process title"
url="https://github.com/dvarrazzo/py-setproctitle"
arch="all"
license="BSD-3-Clause"
depends="python3"
makedepends="musl-dev py3-gpep517 py3-setuptools py3-wheel python3-dev"
checkdepends="procps-ng py3-pytest"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/dvarrazzo/py-setproctitle/archive/version-$pkgver.tar.gz"
builddir="$srcdir/py-$_pkgname-version-$pkgver"

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

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
}

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

sha512sums="
3ba4f6109f58279f2286d9621309b4881c2058cd500a67e6ab669b50a7fa0a15c98ebad4cbdad2fbc50651c9e4d2990e2bb6a4242421eddc6bca980ac2c0d0fe  setproctitle-1.3.5.tar.gz
"
