3
3
4
4
pkgname=python-aws-xray-sdk
5
5
_pkgname=aws-xray-sdk-python
6
- pkgver=2.10.0
6
+ pkgver=2.11.0
7
+ _commit=b37ae1100350780a3862297fe9d2c364bb39510f
7
8
pkgrel=1
8
9
pkgdesc=' AWS X-Ray SDK for Python'
9
10
arch=(any)
10
11
url=' https://github.com/aws/aws-xray-sdk-python'
11
12
license=(Apache)
12
- # Not including python-future as it's needed only on Python 2
13
- # https://github.com/aws/aws-xray-sdk-python/pull/343
14
13
depends=(python python-botocore python-wrapt)
15
14
# See extensions in https://github.com/aws/aws-xray-sdk-python/tree/master/aws_xray_sdk/ext
16
15
optdepends=(python-aiobotocore python-aiohttp python-bottle python-django
17
- python-flask python-flask-sqlalchemy python-mysql-connector
16
+ python-flask python-flask-sqlalchemy python-httpx python- mysql-connector
18
17
python-pg8000 python-psycopg2 python-pymongo python-pymysql
19
18
python-pynamodb python-requests python-sqlalchemy)
20
- makedepends=(python-setuptools ${optdepends[@]} )
21
- checkdepends=(python-pytest python-pytest-asyncio python-pytest-aiohttp python- testing.postgresql
19
+ makedepends=(git python-setuptools ${optdepends[@]} )
20
+ checkdepends=(python-pytest python-pytest-asyncio python-testing.postgresql
22
21
python-webtest python-django-fake-model python-mock python-pytest-benchmark)
23
- # Not using PyPI source tarball as it does not include tests
24
- source=(" https://github.com/aws/aws-xray-sdk-python/archive/$pkgver /$pkgname -$pkgver .tar.gz"
25
- " python310.diff" )
26
- sha256sums=(' ac44b578718a6d975e980354194e1a4e300f9713bf60b74dbe1ce62efe6dd1ed'
27
- ' 11784ed0d9b9f89bf1cc43a6d97d8488672b74e3419e121be1a50f09e409ad71' )
22
+ source=(" git+https://github.com/aws/aws-xray-sdk-python.git#commit=$_commit " )
23
+ sha256sums=(' SKIP' )
28
24
29
- prepare () {
30
- cd $_pkgname -$pkgver
31
- # The 'database_version' field relies on a private member in pg8000 [1], which is removed in pg8000 1.21 [2]
32
- # https://github.com/aws/aws-xray-sdk-python/blob/2.8.0/aws_xray_sdk/ext/pg8000/patch.py#L27
33
- # https://github.com/tlocke/pg8000/commit/fa382a2da52c004fa9b98b242e855132d3fd6d23#diff-2d43fca8e06901904747dfab40d9a7a698ff03fab4c9ba1c01a8ce04105d537eL799
34
- sed -i " /sql\['database_version'\]/d" tests/ext/pg8000/test_pg8000.py
25
+ _backports=(
26
+ # The following three are from https://github.com/aws/aws-xray-sdk-python/pull/364 (ongoing)
27
+ # Use fixture event_loop instead of the deprecated fixture loop
28
+ 72dcbf97a27a44e87123630fe78ff828eafa4d4c
29
+ # Do not pass event loop to asyncio.sleep() and wait() on Python 3.8+
30
+ dde50155e7a912aef80199a1d0c2e9900002af5f
31
+ # Do not pass coroutine objects directly to asyncio.wait()
32
+ b3d605d145dda82b9bcaa2fdac7eb593770886b2
33
+ )
34
+
35
+ pkgver () {
36
+ cd $_pkgname
37
+ git describe --tags | sed ' s/^v//;s/-/+/g'
38
+ }
35
39
36
- # Django 4.x compatibility; see https://docs.djangoproject.com/en/3.2/ref/urls/#url
37
- sed -i ' s#from django.conf.urls import url#from django.urls import re_path as url# ' tests/ext/django/app/views.py
40
+ prepare () {
41
+ cd $_pkgname
38
42
39
- # https://github.com/aws/aws-xray-sdk-python/issues/321
40
- patch -Np1 -i ../python310.diff
43
+ # this loop is stolen from core/systemd :)
44
+ local _c
45
+ for _c in " ${_backports[@]} " ; do
46
+ git log --oneline -1 " ${_c} "
47
+ git cherry-pick -n " ${_c} "
48
+ done
41
49
42
50
cat > pytest.ini << EOF
43
51
[pytest]
46
54
}
47
55
48
56
build () {
49
- cd $_pkgname - $pkgver
57
+ cd $_pkgname
50
58
python setup.py build
51
59
}
52
60
53
61
check () {
54
- cd $_pkgname - $pkgver
62
+ cd $_pkgname
55
63
56
64
# See setenv= in upstream tox.ini
57
65
export DJANGO_SETTINGS_MODULE=tests.ext.django.app.settings
@@ -62,12 +70,16 @@ check() {
62
70
# dropped in the latest pytest-aiohttp
63
71
# * the test suite for pymysql uses testing.mysqld, which is not
64
72
# compatible with MariaDB [1]
73
+ # * tests fail with pg8000 > 1.20.0 and upstream explicitly
74
+ # states no support [2]
65
75
# [1] https://github.com/tk0miya/testing.mysqld/issues/3
76
+ # [2] https://github.com/aws/aws-xray-sdk-python/pull/324
66
77
pytest -v tests --ignore tests/ext/aiohttp \
78
+ --ignore tests/ext/pg8000 \
67
79
--ignore tests/ext/pymysql
68
80
}
69
81
70
82
package () {
71
- cd $_pkgname - $pkgver
83
+ cd $_pkgname
72
84
python setup.py install --root=" $pkgdir " --optimize=1 --skip-build
73
85
}
0 commit comments