summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aef7d4a266d04237dd3da7efc01d0bac7ab12844 (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
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
# Contributor: LinArcX <LinArcX at gmail . com>
_base=requests-cache
pkgname=python-${_base}-git
_pkgname=${pkgname%-git}
_gitcommit=4f13fb21bec27d1a89f585bfa544411844594cb6
pkgdesc="Transparent persistent cache for http://python-requests.org library (git version)"
pkgver=0.8.r1.4f13fb2
pkgrel=1
arch=('any')
url="https://github.com/reclosedev/${_base}"
license=('custom:BSD-2-clause')
depends=(python-requests python-url-normalize python-cattrs python-appdirs)
makedepends=(python-build python-install python-poetry git)
optdepends=('python-boto3: Cache backend for Amazon DynamoDB database'
  'python-redis: Cache backend for Redis cache'
  'python-pymongo: Cache backend for MongoDB database') # python-botocore python-yaml python-sphinx-furo python-linkify-it-py python-myst-parser
checkdepends=(python-pytest python-requests-mock python-responses python-itsdangerous python-ujson python-timeout-decorator)
# python-pymongo python-redis redis python-boto3
source=("git+${url}#commit=${_gitcommit}")
sha512sums=('SKIP')
provides=(${_pkgname})
conflicts=(${_pkgname})

export PYTHONPYCACHEPREFIX="${BUILDDIR}/${pkgname}/.cache/cpython/"

pkgver() {
  cd "${_base}"
  printf "0.8.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "${_base}"
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd "${_base}"
  python -m pytest --ignore=tests/integration
}

package() {
  cd "${_base}"
  export PYTHONHASHSEED=0
  python -m install --optimize=1 --destdir="${pkgdir}" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${_pkgname}"
}