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

pkgname=python-fixtures
pkgver=4.1.0
pkgrel=3
pkgdesc="Fixtures, reusable state for writing clean tests and more"
arch=(any)
license=('Apache')
url="https://launchpad.net/python-fixtures"
depends=('python-pbr')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-testtools')
source=("https://pypi.io/packages/source/f/fixtures/fixtures-$pkgver.tar.gz")
sha512sums=('6897449fdefd07abe7714186b366fdf4505283f6747f8fa4d17044bc45da58eb36e69d89381527ccecb98e6c62c58bc6d4f558af41cbfc87b0221ae60ba71ff6')

prepare() {
  cd fixtures-$pkgver
  sed -i 's/import mock/from unittest import mock/' fixtures/tests/_fixtures/test_mockpatch.py
}

build() {
  cd fixtures-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd fixtures-$pkgver
  python -m testtools.run fixtures.test_suite
}

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