Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 4be28a2

Browse files
yan12125svntogit
yan12125
authored and
svntogit
committed
upgpkg: python-aws-xray-sdk 2.11.0-1
* Switch to upstream patches * Switch sources to git repo for easier backporting * Cleanup comments * Add httpx for [1] * Disable broken tests [1] aws/aws-xray-sdk-python#357 git-svn-id: file:///srv/repos/svn-community/svn@1346564 9fca08f4-af9d-4005-b8df-a31f2cc04f65
1 parent 2bb1a88 commit 4be28a2

File tree

2 files changed

+36
-60
lines changed

2 files changed

+36
-60
lines changed

trunk/PKGBUILD

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,49 @@
33

44
pkgname=python-aws-xray-sdk
55
_pkgname=aws-xray-sdk-python
6-
pkgver=2.10.0
6+
pkgver=2.11.0
7+
_commit=b37ae1100350780a3862297fe9d2c364bb39510f
78
pkgrel=1
89
pkgdesc='AWS X-Ray SDK for Python'
910
arch=(any)
1011
url='https://github.com/aws/aws-xray-sdk-python'
1112
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
1413
depends=(python python-botocore python-wrapt)
1514
# See extensions in https://github.com/aws/aws-xray-sdk-python/tree/master/aws_xray_sdk/ext
1615
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
1817
python-pg8000 python-psycopg2 python-pymongo python-pymysql
1918
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
2221
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')
2824

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+
}
3539

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
3842

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
4149

4250
cat > pytest.ini <<EOF
4351
[pytest]
@@ -46,12 +54,12 @@ EOF
4654
}
4755

4856
build() {
49-
cd $_pkgname-$pkgver
57+
cd $_pkgname
5058
python setup.py build
5159
}
5260

5361
check() {
54-
cd $_pkgname-$pkgver
62+
cd $_pkgname
5563

5664
# See setenv= in upstream tox.ini
5765
export DJANGO_SETTINGS_MODULE=tests.ext.django.app.settings
@@ -62,12 +70,16 @@ check() {
6270
# dropped in the latest pytest-aiohttp
6371
# * the test suite for pymysql uses testing.mysqld, which is not
6472
# compatible with MariaDB [1]
73+
# * tests fail with pg8000 > 1.20.0 and upstream explicitly
74+
# states no support [2]
6575
# [1] https://github.com/tk0miya/testing.mysqld/issues/3
76+
# [2] https://github.com/aws/aws-xray-sdk-python/pull/324
6677
pytest -v tests --ignore tests/ext/aiohttp \
78+
--ignore tests/ext/pg8000 \
6779
--ignore tests/ext/pymysql
6880
}
6981

7082
package() {
71-
cd $_pkgname-$pkgver
83+
cd $_pkgname
7284
python setup.py install --root="$pkgdir" --optimize=1 --skip-build
7385
}

trunk/python310.diff

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)