# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>

pkgname=python-pytest-expect
pkgver=1.1.0
pkgrel=14
pkgdesc='pytest plugin that stores test expectations by saving the set of failing tests'
arch=(any)
url='https://github.com/gsnedders/pytest-expect'
license=(MIT)
depends=(
  python
  python-pytest
  python-u-msgpack
)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
source=("$pkgname::git+$url#tag=$pkgver")
sha512sums=('bf39e23c4f38b680dde360757781fc9dadd077c37ecefd9f5bf4ef62fe43702c1f6e006b7196e7105f57ee9ac0a6cccc170879eecc729fdfa47346c3b81ac95d')
b2sums=('b815588bbde3801e422261e01cdc1aa2bc4c8794ca7a07e17b8a29cf781969e69f0b7459759ec3daf7564205da631a826d51ac8db04060e448c39139cba65e2d')

prepare() {
  cd "$pkgname"

  # remove python2 support & dependency on python-six
  git cherry-pick --no-commit 790d299540a33b677f2a3c27dac39b27efdc1e08
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
