# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Padraic Fanning <fanninpm AT miamioh DOT edu>

pkgname=python-exceptiongroup
_pyname=${pkgname#python-}
pkgver=1.3.0
pkgrel=1
pkgdesc='Backport of PEP 654 (exception groups)'
arch=(any)
url="https://github.com/agronholm/$_pyname"
license=(MIT)
depends=('python')
makedepends=(python-{build,installer,wheel}
             python-flit-scm)
checkdepends=(python-pytest)
_archive="$_pyname-$pkgver"
source=("$url/archive/$pkgver/$_archive.tar.gz")
sha256sums=('7af03131ce1ad5177a6e449b7dc36aa9148bb9103654542a7217f5842a4df551')

build() {
	cd "$_archive"
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	python -m build -wn
}

check() {
	cd "$_archive"
	PYTHONPATH=src pytest
}

package() {
	cd "$_archive"
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	python -m installer -d "$pkgdir" dist/*.whl
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}
