# Maintainer: Daniel Mizyrycki <mzdaniel@glidelink.net>
pkgname=py3-docopt-ng
pkgver=0.9.0
pkgrel=3
pkgdesc="Humane command line arguments parser"
url="https://github.com/jazzband/docopt-ng"
arch="noarch"
license="MIT"
depends="python3"
makedepends="
	py3-gpep517
	py3-pdm-backend
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jazzband/docopt-ng/archive/refs/tags/$pkgver.tar.gz
	fix-PytestRemovedIn9Warning.patch
	"
builddir="$srcdir/docopt-ng-$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
}

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

sha512sums="
51d52d9fc459702006d2362c23effb3122453efe49c4a10aa5bb6adc7661c77e5eb6445afb937512c9840687880b2579212188e6bb7f8c16562725cf7c809a6d  py3-docopt-ng-0.9.0.tar.gz
1f2474220c395c5843936a32c616a69d1bd0017d169ed7aa9f3a9279621524690fb2f97fe7d4ce178807135a8642bb1c23758b71866584c46e67836a544bcc48  fix-PytestRemovedIn9Warning.patch
"
