_pkgname='pathvalidate'
pkgname=python-$_pkgname
pkgver=3.3.1
pkgrel=2
pkgdesc='Sanitize/validate strings in filenames/file-paths/etc'
arch=('any')
url='https://github.com/thombashi/pathvalidate'
license=('MIT')
depends=('python' 'python-click')
makedepends=('python-setuptools-scm' 'python-wheel' 'python-installer' 'python-build' git)
source=("git+https://github.com/thombashi/pathvalidate#tag=v${pkgver}")
sha256sums=('cc8dddedde8ab7d72e4be9bc08e6d9ce4f27fa092040215169972970483b658f')

build() {
  cd pathvalidate
  python -m build --wheel --no-isolation
}

package() {
  cd pathvalidate
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dvm644 'README.rst' -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dvm644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
