# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=pipx
pkgver=1.7.1
pkgrel=0
pkgdesc="Install and Run Python Applications in Isolated Environments"
url="https://github.com/pypa/pipx"
arch="noarch"
license="MIT"
depends="
	py3-argcomplete
	py3-colorama
	py3-packaging
	py3-platformdirs
	py3-userpath
	"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-hatch-vcs
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver-1.tar.gz::https://github.com/pypa/pipx/archive/refs/tags/$pkgver.tar.gz"
options="!check" # need some packages that i'm not sure of

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	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 -p no:warnings
}

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

sha512sums="
6375d413974477f488eb8c8d95594f39cf7c54e4c09639c95cb82ed58467266c0124259b1a1fc07596ac0fbffc9fd2ff2fffe58083d78e67ca9f056f2353852f  pipx-1.7.1-1.tar.gz
"
