summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 31d70a0bfefbb53df7cf76a0b3b734126ddbdf9f (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
43
44
45
46
47
48
49
50
51
52
53
# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=abydos
pkgname=python-${_pkg,,}
pkgver=0.5.0
pkgrel=7
pkgdesc="NLP/IR library for Python"
arch=(any)
url="https://github.com/chrislit/abydos"
license=(GPL-3.0-or-later)
depends=(python-numpy)
makedepends=(
    python-build
    python-installer
    python-setuptools
    python-wheel
)
checkdepends=(
    python-pytest
    python-deprecation
    python-nltk
)
# No tests in PyPi tarballs
#source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
source=(${url}/archive/v${pkgver}/${_pkg}-${pkgver}.tar.gz
        python310.patch)
sha256sums=('0d46be1a40cfcdcd9ff9d052828c6ea57f5e1e2378373761c963c4a0cfcc5512'
            '33d7c2d13f7e87c33c6f92caf934b6eb10b9503b1334068aee7b4de6bc2660e3')

prepare() {
  cd ${_pkg}-${pkgver}
  patch -Np1 -i ../python310.patch
  find -name '*.py' -exec sed -e 's|from numpy import float |from numpy import float_ |g' \
                              -e 's|numpy import int |numpy import int_ |g' \
                              -e 's|dtype=np\.bool)|dtype=np.bool_)|g' \
                              -e 's|dtype=np\.float)|dtype=np.float_)|g' -i {} \;
}

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

check() {
  cd ${_pkg}-${pkgver}
  rm setup.cfg
  pytest -k 'not test_mean_pairwise_similarity' # numerical noise
}

package() {
  cd ${_pkg}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
}