summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c9e1b42f6e530493d4b367c87ad6bea86949f8d2 (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
54
55
56
57
58
59
60
61
62
63
# Maintainer: xiota / aur.chaotic.cx
# Contributor: Dobroslaw Kijowski [dobo] <dobo90_at_gmail.com>
# Contributor: oldNo.7 <oldNo.7@archlinux.org>

## useful links
# https://pypi.python.org/pypi/thefuzz

_module="thefuzz"
_pkgname="python-$_module"
pkgname="$_pkgname"
pkgver=0.22.1
pkgrel=2
pkgdesc='Fuzzy string matching in Python'
url="https://github.com/seatgeek/thefuzz"
license=('MIT')
arch=('any')

depends=(
  'python'
  'python-rapidfuzz'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-hypothesis'
  'python-pycodestyle'
  'python-pytest'
)

provides=("python-fuzzywuzzy=0.18.0")
conflicts=("python-fuzzywuzzy")

_pkgsrc="$_module"
source+=("$_pkgsrc"::"git+$url.git#tag=${pkgver%%.r*}")
sha256sums+=('SKIP')

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

check() {
  cd "$_pkgsrc"
  pytest
}

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

  local _sitepackages="$(python -c 'import site; print(site.getsitepackages()[0])')"

  # provide fuzzywuzzy for backward compatibility
  ln -vsf "$_pkgsrc" "${pkgdir}${_sitepackages}/fuzzywuzzy"

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