# Maintainer: atom2013 <atom.long@hotmail.com>

pkgbase=python-appdirs
pkgname=(python-appdirs)
pkgver=1.4.4
pkgrel=7
pkgdesc='A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".'
arch=('any')
url="https://github.com/ActiveState/appdirs"
msys2_references=(
  "purl: pkg:pypi/appdirs"
)
license=('spdx:MIT')
depends=('python')
makedepends=(
  'python-setuptools'
  'python-build'
  'python-installer'
)
provides=('python3-appdirs')
replaces=('python3-appdirs')
conflicts=('python3-appdirs')
source=("https://pypi.io/packages/source/a/appdirs/appdirs-${pkgver}.tar.gz")
sha256sums=('7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41')

build() {
  cd "$srcdir"/appdirs-$pkgver

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

check() {
  cd "${srcdir}"/appdirs-${pkgver}

  python -m unittest discover
}

package() {
  cd appdirs-${pkgver}

  python -m installer --destdir="${pkgdir}" dist/*.whl

  install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE.txt
}
