# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_pyname=setuptools_scm
_realname=setuptools-scm
pkgbase="python-${_realname}"
pkgname=("python-${_realname}")
pkgver=9.2.0
pkgrel=1
pkgdesc="Handles managing your python package versions in scm metadata"
arch=('any')
license=('spdx:MIT')
url='https://github.com/pypa/setuptools_scm'
msys2_references=(
  "anitya: 65053"
  "purl: pkg:pypi/setuptools-scm"
)
depends=(
  'python'
  'python-setuptools'
  'python-packaging'
  'python-typing_extensions'
)
makedepends=(
  "python-build"
  "python-installer"
)
source=("https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('6662c9b9497b6c9bf13bead9d7a9084756f68238302c5ed089fb4dbd29d102d7')

build() {
  cd "${_pyname}-${pkgver}"

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

package() {
  cd "${_pyname}-${pkgver}"

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