# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-setuptools-git
pkgver=1.2
pkgrel=11
pkgdesc='Setuptools revision control system plugin for Git'
arch=(any)
license=('BSD')
url='https://github.com/msabramo/setuptools-git'
depends=('python-setuptools' 'git')
makedepends=('python-build' 'python-installer' 'python-wheel')
source=("$pkgname-$pkgver.tar.gz::https://github.com/msabramo/setuptools-git/archive/$pkgver.tar.gz")
sha512sums=('368d56003a440c5be00685356b0aef97fdea4a84a6d4e56d59964833b55de4916353e061f2eebf2de4dac2df4783a0a1b2d58ba88e1a93979b38a2b62900c1c1')

build() {
  cd "$srcdir"/setuptools-git-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd "$srcdir"/setuptools-git-$pkgver
  GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=user.email GIT_CONFIG_VALUE_0=deedbeaf python -m unittest -v
}

package() {
  cd setuptools-git-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -D -m644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
}

# vim:set ts=2 sw=2 et:
