Date: Wednesday, December 1, 2021 @ 14:50:11 Author: foutrelis Revision: 1059380
archrelease: copy trunk to community-staging-any Added: python-aws-xray-sdk/repos/community-staging-any/ python-aws-xray-sdk/repos/community-staging-any/PKGBUILD (from rev 1059379, python-aws-xray-sdk/trunk/PKGBUILD) ----------+ PKGBUILD | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) Copied: python-aws-xray-sdk/repos/community-staging-any/PKGBUILD (from rev 1059379, python-aws-xray-sdk/trunk/PKGBUILD) =================================================================== --- community-staging-any/PKGBUILD (rev 0) +++ community-staging-any/PKGBUILD 2021-12-01 14:50:11 UTC (rev 1059380) @@ -0,0 +1,62 @@ +# Maintainer: Chih-Hsuan Yen <yan12...@archlinux.org> +# Contributor: Guillaume Horel <guillaume.ho...@gmail.com> + +pkgname=python-aws-xray-sdk +_pkgname=aws-xray-sdk-python +pkgver=2.8.0 +pkgrel=3 +pkgdesc='AWS X-Ray SDK for Python' +arch=(any) +url='https://github.com/aws/aws-xray-sdk-python' +license=(Apache) +# XXX: move setuptools back to makedepends in the next version +# https://github.com/aws/aws-xray-sdk-python/pull/306 +makedepends=() +depends=(python python-botocore python-future python-wrapt python-setuptools) +checkdepends=(python-flask-sqlalchemy python-pynamodb python-pytest python-aiohttp + python-pytest-aiohttp python-testing.postgresql python-psycopg2 + python-pg8000 python-requests python-aiobotocore python-bottle + python-webtest python-django-fake-model python-mock python-sqlalchemy) +# Not using PyPI source tarball as it does not include tests +source=("https://github.com/aws/aws-xray-sdk-python/archive/$pkgver/$pkgname-$pkgver.tar.gz") +sha256sums=('3f94ee35d8e34022939153dcc6d5bd8bce1428ee4811f0ee4713e40dae8b22dd') + +prepare() { + cd $_pkgname-$pkgver + # The 'database_version' field relies on a private member in pg8000 [1], which is removed in pg8000 1.21 [2] + # https://github.com/aws/aws-xray-sdk-python/blob/2.8.0/aws_xray_sdk/ext/pg8000/patch.py#L27 + # https://github.com/tlocke/pg8000/commit/fa382a2da52c004fa9b98b242e855132d3fd6d23#diff-2d43fca8e06901904747dfab40d9a7a698ff03fab4c9ba1c01a8ce04105d537eL799 + sed -i "/sql\['database_version'\]/d" tests/ext/pg8000/test_pg8000.py + + # top-level `get_session` is removed by default since aiobotocore 2.0.0 + # https://github.com/aio-libs/aiobotocore/releases/tag/2.0.0 + sed -i -e "s/import aiobotocore$/import aiobotocore.session/g" \ + -e "s/aiobotocore\.get_session/aiobotocore.session.get_session/g" tests/ext/aiobotocore/test_aiobotocore.py +} + +build() { + cd $_pkgname-$pkgver + python setup.py build +} + +check() { + cd $_pkgname-$pkgver + + # See setenv= in upstream tox.ini + export DJANGO_SETTINGS_MODULE=tests.ext.django.app.settings + export AWS_SECRET_ACCESS_KEY=fake_key + export AWS_ACCESS_KEY_ID=fake_id + + # the test suite for pymysql uses testing.mysqld, which is not + # compatible with MariaDB + # https://github.com/tk0miya/testing.mysqld/issues/3 + # Tests in test_sqlalchemy_core_2.py need sqlalchemy >= 1.4 [1] + # https://github.com/aws/aws-xray-sdk-python/pull/289 + pytest -v tests --ignore tests/ext/pymysql \ + --ignore tests/ext/sqlalchemy_core/test_sqlalchemy_core_2.py +} + +package() { + cd $_pkgname-$pkgver + python setup.py install --root="$pkgdir" --optimize=1 --skip-build +}