# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-google-auth-httplib2
pkgver=0.2.1
pkgrel=1
pkgdesc="Google Authentication Library: httplib2 transport"
url="https://github.com/googleapis/google-auth-library-python-httplib2"
license=('Apache-2.0')
arch=('any')
depends=('python-google-auth' 'python-httplib2')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest' 'python-flask' 'python-pytest-localserver')
source=("git+https://github.com/googleapis/google-auth-library-python-httplib2.git#tag=v$pkgver")
sha512sums=('7c8b101a0722006721d1e39eb0dd13dd4a363dd2c3b36c921ec1291a08f00ba2ece06a191128dfbbf1e5c2ee4428258a1d92cea3e611dbcfc3b5a0eaa10478bf')

build() {
  cd google-auth-library-python-httplib2
  python -m build --wheel --no-isolation
}

check() {
  cd google-auth-library-python-httplib2
  pytest
}

package() {
  cd google-auth-library-python-httplib2
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
