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

pkgname=python-requests-mock
pkgver=1.12.1
_commit=fba8cc7faf83be9f1505625d566721ee6c68ed39
pkgrel=1
pkgdesc="A mock of useful classes and functions to be used with python-requests."
arch=('any')
url="https://github.com/jamielennox/requests-mock"
license=('Apache')
depends=('python-requests' 'python')
makedepends=('git' 'python-setuptools' 'python-setuptools-scm' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-purl' 'python-pytest' 'python-requests-futures' 'python-testtools' 'python-fixtures' 'python-pbr')
source=("git+https://github.com/jamielennox/requests-mock.git#commit=$_commit")
sha512sums=('2e539ac04e950f08a6de44355a2d6e878980b7c86a8ddcbaf2ce526de6f4342f61fe51874e5b64809723a1295e2f00f8ee451f643d407327e1284df1602f5537')

build() {
  cd requests-mock
  python -m build --wheel --no-isolation
}

check() {
  cd requests-mock
  python -m pytest tests/pytest
  python -m testtools.run discover
}

package() {
  cd requests-mock
  python -m installer --destdir="$pkgdir" dist/*.whl
}
