# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>

_realname=hatch-fancy-pypi-readme
pkgbase=python-hatch-fancy-pypi-readme
pkgname=("python-${_realname}")
pkgver=25.1.0
pkgrel=1
pkgdesc="Fancy PyPI READMEs with Hatch"
arch=('any')
license=('spdx:MIT')
url="https://github.com/hynek/hatch-fancy-pypi-readme"
msys2_references=(
  "purl: pkg:pypi/hatch-fancy-pypi-readme"
)
depends=('python'
         'python-hatchling')
makedepends=(
  'python-build'
  'python-installer'
)
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname//-/_}-${pkgver}.tar.gz")
sha256sums=('9c58ed3dff90d51f43414ce37009ad1d5b0f08ffc9fc216998a06380f01c0045')

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.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
