archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-natsort / trunk / PKGBUILD
blob076be233350a96cffa5c4248f844f4e509527d67
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 _name=natsort
4 pkgname=python-natsort
5 pkgver=8.3.1
6 pkgrel=2
7 pkgdesc="Simple yet flexible natural sorting in Python"
8 arch=(any)
9 url="https://github.com/SethMMorton/natsort"
10 license=(MIT)
11 depends=(python python-typing-extensions)
12 makedepends=(python-build python-installer python-setuptools python-wheel)
13 checkdepends=(python-hypothesis python-pytest-mock)
14 optdepends=(
15   'python-fastnumbers: more efficient sorting'
16   'python-pyicu: sort in locale dependant manner'
18 source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
19 sha512sums=('98ee9bfed9307487b9ae9ced5ce723b6840c6f882d06702f205986430572b767f3ac0930ffdf0663d99256f6feed704394b2b7e11f4b01f4f0241cd8639df622')
20 b2sums=('3ad4d8884b463fa792f7930f6d92dda146c96cd929a58a1d418c59f8b3c5fc06329e2cf0341963c820fb8d2fc67b287ce69083a2cba9f20bd8abc06c0fca6a44')
22 build() {
23   cd $_name-$pkgver
24   python -m build --wheel --no-isolation
27 check() {
28   local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
30   cd $_name-$pkgver
31   python -m installer --destdir=test_dir dist/*.whl
32   export PYTHONPATH="test_dir/$_site_packages:$PYTHONPATH"
33   pytest -vv
36 package() {
37   cd $_name-$pkgver
38   python -m installer --destdir="$pkgdir" dist/*.whl
39   install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
40   install -vDm 644 {CHANGELOG.md,README.rst} -t "$pkgdir/usr/share/doc/$pkgname/"