# Maintainer: Jordan Cook # Maintainer: Carlos Aznarán # Maintainer: Philipp A. # Contributor: Benoit Pierre # Contributor: Simon Legner # Contributor: Aniket Pradhan # Contributor: Roman Haritonov _base=requests-cache pkgname=python-${_base} pkgdesc="Transparent persistent cache for http://python-requests.org library" pkgver=0.9.3 pkgrel=1 arch=(any) url="https://github.com/reclosedev/${_base}" license=('custom:BSD-2-clause') depends=(python-requests python-appdirs python-cattrs python-url-normalize) makedepends=(python-build python-install python-poetry-core) optdepends=('python-boto3: Cache backend for Amazon DynamoDB database' 'python-botocore: Interface for Amazon Web Services' 'python-pymongo: Cache backend for MongoDB database' 'python-redis: Cache backend for Redis cache' 'python-bson: for BSON codec' 'python-itsdangerous: for pass trusted data to untrusted environments' 'python-yaml: for bindings yaml support' 'python-ujson: for JSON serializer for improved performance') checkdepends=(python-pytest python-requests-mock python-responses python-itsdangerous python-ujson python-timeout-decorator) source=(${_base}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz) sha512sums=('d413fbed156bd3fca48db8b153b01a883ee72d62f6e8982d490a5378dc188c19d0b3af5e37e6f47d19ed0ba11b3c0e01489720d56df12afcf1b47088e1541221') build() { cd ${_base}-${pkgver} export PYTHONHASHSEED=0 # Note: set `GIT_CEILING_DIRECTORIES` to prevent poetry # from incorrectly using a parent git checkout info. # https://github.com/pypa/build/issues/384#issuecomment-947675975 GIT_CEILING_DIRECTORIES="${PWD}/.." python -m build --wheel --skip-dependency-check --no-isolation } check() { cd ${_base}-${pkgver} python -m pytest --ignore=tests/integration } package() { cd ${_base}-${pkgver} python -m install --optimize=1 --destdir="${pkgdir}" dist/*.whl install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" }