# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Rafael Fontenelle <rafaelff@gnome.org>

pkgname=python-pytest-datafiles
pkgver=3.0.1
pkgrel=1
pkgdesc='pytest plugin to create a tmpdir containing predefined files/directories'
arch=(any)
url='https://github.com/omarkohl/pytest-datafiles'
license=(MIT)
depends=(
  python
  python-pytest
)
makedepends=(
  git
  python-build
  python-installer
  python-hatchling
)
source=("$pkgname::git+$url#tag=$pkgver")
sha512sums=('194911fcb429a6d64bc824e801eb5f5cd9d223273b0e5c40cc6ee75b9eac3b760baa446712ee4b763ae7e7b7fbac2f8d9410cdedad1556657a1904efc5661128')
b2sums=('4aaa33824235bd454ef82625802a8a3936a529c7060f65ab227f54b17f8cdcdd526a193b2f5b88cc69c436b4dca7b37d3a01960f25c92de4125193db64aa6586')

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
}
