1 # Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
2 # Contributor: Guillaume Horel <guillaume.horel@gmail.com>
4 pkgname=python-aws-xray-sdk
5 _pkgname=aws-xray-sdk-python
7 _commit=c57d293198251e276988440400140ac247c24606
9 pkgdesc='AWS X-Ray SDK for Python'
11 url='https://github.com/aws/aws-xray-sdk-python'
13 depends=(python python-botocore python-wrapt)
14 # See extensions in https://github.com/aws/aws-xray-sdk-python/tree/master/aws_xray_sdk/ext
15 optdepends=(python-aiobotocore python-aiohttp python-bottle python-django
16 python-flask python-flask-sqlalchemy python-httpx python-mysql-connector
17 python-pg8000 python-psycopg2 python-pymongo python-pymysql
18 python-pynamodb python-requests python-sqlalchemy)
19 makedepends=(git python-setuptools ${optdepends[@]})
20 checkdepends=(python-pytest python-pytest-asyncio python-testing.postgresql
21 python-webtest python-django-fake-model python-pytest-benchmark)
22 source=("git+https://github.com/aws/aws-xray-sdk-python.git#commit=$_commit")
30 git describe --tags | sed 's/^v//;s/-/+/g'
36 # this loop is stolen from core/systemd :)
38 for _c in "${_backports[@]}"; do
39 git log --oneline -1 "${_c}"
40 git cherry-pick -n "${_c}"
43 cat > pytest.ini <<EOF
57 # See setenv= in upstream tox.ini
58 export DJANGO_SETTINGS_MODULE=tests.ext.django.app.settings
59 export AWS_SECRET_ACCESS_KEY=fake_key
60 export AWS_ACCESS_KEY_ID=fake_id
62 # * the test suite for aiohttp uses test_client fixture, which is
63 # dropped in the latest pytest-aiohttp
64 # * the test suite for pymysql uses testing.mysqld, which is not
65 # compatible with MariaDB [1]
66 # * tests fail with pg8000 > 1.20.0 and upstream explicitly
67 # states no support [2]
68 # [1] https://github.com/tk0miya/testing.mysqld/issues/3
69 # [2] https://github.com/aws/aws-xray-sdk-python/pull/324
70 pytest -v tests --ignore tests/ext/aiohttp \
71 --ignore tests/ext/pg8000 \
72 --ignore tests/ext/pymysql
77 python setup.py install --root="$pkgdir" --optimize=1 --skip-build