archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-aiobotocore / repos / community-any / PKGBUILD
blob24dba98da5dd6c36b88e19e574accd0552220d7a
1 # Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
3 pkgname=python-aiobotocore
4 _pkgname=aiobotocore
5 # https://github.com/aio-libs/aiobotocore/releases
6 pkgver=2.5.0
7 pkgrel=3
8 pkgdesc='asyncio support for botocore library using aiohttp'
9 arch=(any)
10 url='https://github.com/aio-libs/aiobotocore'
11 license=(Apache)
12 depends=(python python-aiohttp python-botocore python-wrapt python-aioitertools)
13 makedepends=(python-setuptools)
14 checkdepends=(python-moto python-pytest python-pytest-asyncio
15               # moto optdepends
16               python-docker python-openapi-spec-validator python-yaml python-flask python-flask-cors)
17 source=("https://github.com/aio-libs/aiobotocore/archive/$pkgver/$pkgname-$pkgver.tar.gz")
18 sha256sums=('ef7ec846afe19be0832ed7caefd5ef884e48824bf3cb98cdcb117992561d4429')
20 prepare() {
21   cd $_pkgname-$pkgver
23   # Disable dependency pinning
24   # Upstream tracking issue: https://github.com/aio-libs/aiobotocore/issues/670
25   sed --in-place=.orig -r "s#'(botocore.*),<.*',#'\1',#" setup.py
26   diff -u setup.py{.orig,} || true
28   # For pytest-asyncio >= 0.19
29   # https://github.com/aio-libs/aiobotocore/issues/965
30   echo asyncio_mode = auto >> pytest.ini
33 build() {
34   cd $_pkgname-$pkgver
35   python setup.py build
38 check() {
39   cd $_pkgname-$pkgver
41   export PYTHONPATH="$PWD"
42   # test_lambda uses moto.awslambda, which requires a running Docker service
43   # See: https://github.com/spulec/moto/issues/3276
44   # test_version checks lower and upper bounds for dependencies in setup.py,
45   # and they are patched away in prepare()
46   pytest -m moto tests \
47       --ignore=tests/test_patches.py \
48       --ignore=tests/test_lambda.py \
49       --ignore=tests/test_version.py
52 package() {
53   cd $_pkgname-$pkgver
54   python setup.py install --root="$pkgdir" --optimize=1 --skip-build