# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=attrs
pkgbase=python-attrs
pkgname=("python-${_realname}")
pkgver=24.3.0
pkgrel=1
pkgdesc="Attributes without boilerplate."
arch=('any')
license=('spdx:MIT')
url="https://attrs.readthedocs.org/"
msys2_references=(
  "pypi:attrs"
)
depends=('python')
makedepends=(
  'python-hatchling'
  'python-hatch-vcs'
  'python-hatch-fancy-pypi-readme'
  'python-build'
  'python-installer'
)
provides=("python3-${_realname}")
replaces=("python3-${_realname}")
conflicts=("python3-${_realname}")
source=("https://pypi.io/packages/source/a/attrs/attrs-$pkgver.tar.gz")
sha512sums=('9974c1510e78887aedae51813d2edcbb5210de302360c1b0e8cd64265b32acae65e633d61d936aaf8541f79180b9e61e1a9e2a88ac09f8ef29423afb340db8ef')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"

  python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"

  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
