upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / python-aws-xray-sdk / trunk / PKGBUILD
blob6e6834b118cbf65470a89f30aa3260c2de633712
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
6 pkgver=2.12.0
7 _commit=c57d293198251e276988440400140ac247c24606
8 pkgrel=3
9 pkgdesc='AWS X-Ray SDK for Python'
10 arch=(any)
11 url='https://github.com/aws/aws-xray-sdk-python'
12 license=(Apache)
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")
23 sha256sums=('SKIP')
25 _backports=(
28 pkgver() {
29   cd $_pkgname
30   git describe --tags | sed 's/^v//;s/-/+/g'
33 prepare() {
34   cd $_pkgname
36   # this loop is stolen from core/systemd :)
37   local _c
38   for _c in "${_backports[@]}"; do
39     git log --oneline -1 "${_c}"
40     git cherry-pick -n "${_c}"
41   done
43   cat > pytest.ini <<EOF
44 [pytest]
45 asyncio_mode = auto
46 EOF
49 build() {
50   cd $_pkgname
51   python setup.py build
54 check() {
55   cd $_pkgname
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
75 package() {
76   cd $_pkgname
77   python setup.py install --root="$pkgdir" --optimize=1 --skip-build