summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1d7263ed033fe8b66a4a6cc70e5c86959e91f020 (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
64
65
66
# Maintainer: BigfootACA <bigfoot@classfun.cn>

pkgname=python-pymemcache
_pkgname=${pkgname#python-}
pkgver=4.0.0
pkgrel=1
pkgdesc="A comprehensive, fast, pure Python memcached client"
arch=(any)
url="https://github.com/pinterest/pymemcache"
license=(Apache-2.0)
depends=(python)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  memcached
  python-faker
  python-gevent
  python-memcached
  python-pylibmc
  python-pytest
  python-zstd
)
source=(
  "$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
  "dont-install-tests.patch"
)
sha256sums=(
  '824b62cb1f099537345abf399a8f419138e9e86b0cf59d3b5c105e8c3ee9828f'
  '04085134ced763386e28b1302d39a05bd15b738d1b61e946f427a535c18860b3'
)

_archive="$_pkgname-$pkgver"

prepare() {
  cd "$_archive"

  patch --strip=1 --input="$srcdir/dont-install-tests.patch"
}

build() {
  cd "$_archive"

  python -m build --wheel --no-isolation
}

check() {
  cd "$_archive"

  memcached --daemon --port 49152 --pidfile "$PWD/memcached.pid"
  trap 'kill $(cat '"$PWD/memcached.pid"')' EXIT
  # Deselected tests failing due to:
  #   TypeError: 'dict' object is not an iterator
  pytest --override-ini="addopts=" pymemcache/test/ \
    --port 49152 \
    --deselect pymemcache/test/test_benchmark.py::test_bench_delete
}

package() {
  cd "$_archive"

  python -m installer --destdir="$pkgdir" dist/*.whl
}