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

pkgname=python-pytest-mock
pkgver=3.14.1
pkgrel=1
pkgdesc="Thin-wrapper around the mock package for easier use with py.test"
arch=('any')
license=('MIT')
url="https://github.com/pytest-dev/pytest-mock/"
depends=('python-pytest')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel'
             'python-setuptools-scm')
checkdepends=('python-pytest-asyncio')
source=("git+https://github.com/pytest-dev/pytest-mock.git#tag=v$pkgver")
sha512sums=('aba45b0bbea6d2b4ab074377d8d84a598644afde479dfcfade1ecb490e8d5d930b1a0791f215a5ecb7afa410d7965b54694769aec3e13de11cce72b99a6ea53f')

build() {
  cd pytest-mock
  python -m build -nw
}

check() {
  cd pytest-mock
  python -m venv tmpenv --system-site-packages
  tmpenv/bin/python -m installer dist/*.whl
  tmpenv/bin/python -m pytest
}

package() {
  cd pytest-mock
  python -m installer -d "$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
