summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bcd7a64d5b23840f5ad18c1a51d7612d1d07ba08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Maintainer: Iyán Méndez Veiga <me (at) iyanmv (dot) com>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Conrad Sachweh <conrad+aur@spamthis.space>
pkgname=python-fastdtw
_name="${pkgname#python-}"
pkgver=0.3.4
pkgrel=2
pkgdesc="Python implementation of FastDTW"
url="https://github.com/slaypni/fastdtw"
arch=('x86_64')
license=('MIT')
depends=('python-numpy')
makedepends=(
    'cython'
    'python-build'
    'python-installer'
    'python-setuptools'
    'python-wheel'
)
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
b2sums=('e3a1e630b615c1e074eb7cfa85d3b3173af3a8cde84a29a4454839a42a349212b638709c2af47aec48cdb3fb52c26282bbdf7c5b0f01de17bdd1c660f66c06b8')

build() {
    cd "$_name-$pkgver"
    python -m build --wheel --no-isolation
}

check() {
    cd "${_name}-${pkgver}"
    python -m installer --destdir="$srcdir/test" dist/*.whl
    local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
    export PYTHONPATH="$srcdir"/test/usr/lib/python${python_version}/site-packages
    pytest -v tests
}

package() {
    cd "$_name-$pkgver"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    install -D -m644 README.rst "$pkgdir/usr/share/doc/$pkgname/README"
}