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

pkgname=python-attrs
pkgver=25.4.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=('8e15f9dbd7ffcb56413dec8b1318b9f7e9ccd4425af6579e9283048caff123eb3ed20e1afc1c16335db47832933d4e3f5239cc5c1472e8201d977391249bfa28')

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

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/"
}
