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

pkgname=python-attrs
pkgver=26.1.0
pkgrel=1
pkgdesc="Attributes without boilerplate."
arch=('any')
license=('MIT')
url="https://www.attrs.org"
depends=('python')
makedepends=(
  'git'
  'python-build'
  'python-hatch-fancy-pypi-readme'
  'python-hatch-vcs'
  'python-hatchling'
  'python-installer'
)
checkdepends=(
  'python-cloudpickle'
  'python-hypothesis'
  'python-pytest'
  'python-zope-interface'
)
source=("git+https://github.com/python-attrs/attrs.git#tag=$pkgver")
sha512sums=('6748df23bb17a72d2ce48034d80c718ce707e13504dc7e7cb4c820170e37ce47b21fc71efb0ff742eae2cac6b383d1909c456b899b1f4a213e5a44b0f4104121')

build() {
  cd ${pkgname#python-}
  python -m build --wheel --no-isolation
}

check() {
  cd ${pkgname#python-}
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest
}

package() {
  cd ${pkgname#python-}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
