# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-cookiecutter
pkgver=2.6.0
pkgrel=1
pkgdesc="A command-line utility that creates projects from project templates"
url="https://github.com/cookiecutter/cookiecutter"
arch="noarch"
license="BSD-3-Clause"
depends="
	bash
	py3-arrow
	py3-binaryornot
	py3-click
	py3-freezegun
	py3-jinja2
	py3-pyaml
	py3-requests
	py3-rich
	py3-slugify
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="
	py3-pytest
	py3-pytest-cov
	py3-pytest-mock
	"
subpackages="$pkgname-doc $pkgname-pyc"
source="py3-cookiecutter-$pkgver.tar.gz::https://github.com/cookiecutter/cookiecutter/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/cookiecutter-$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

	install -Dm 644 README.md -t "$pkgdir"/usr/share/doc/"$pkgname"
}

sha512sums="
619be103bb831cbe9c50c4fa5114d6151a462a29a233f8999305403dda449f90a5900940a2b9d98433a8cdd3dbad421afe6feded42f4bcb6ee83523570ed2c1e  py3-cookiecutter-2.6.0.tar.gz
"
