[arch-commits] Commit in python-aws-xray-sdk/trunk (2 files)

2019-12-06 Thread Chih-Hsuan Yen via arch-commits
Date: Saturday, December 7, 2019 @ 03:21:12
  Author: yan12125
Revision: 536132

upgpkg: python-aws-xray-sdk 2.4.3-1

All patches are upstreamed

Modified:
  python-aws-xray-sdk/trunk/PKGBUILD
Deleted:
  python-aws-xray-sdk/trunk/python-aws-xray-sdk-botocore-1.13.patch

-+
 PKGBUILD|   23 +---
 python-aws-xray-sdk-botocore-1.13.patch |   80 --
 2 files changed, 4 insertions(+), 99 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2019-12-07 01:28:30 UTC (rev 536131)
+++ PKGBUILD2019-12-07 03:21:12 UTC (rev 536132)
@@ -3,8 +3,8 @@
 
 pkgname=python-aws-xray-sdk
 _pkgname=aws-xray-sdk-python
-pkgver=2.4.2
-pkgrel=7
+pkgver=2.4.3
+pkgrel=1
 pkgdesc='AWS X-Ray SDK for Python'
 arch=(any)
 url='https://github.com/aws/aws-xray-sdk-python'
@@ -15,24 +15,9 @@
   python-pytest-aiohttp python-testing.postgresql python-psycopg2
   python-pg8000 python-requests python-aiobotocore)
 # 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;
-
"aws-xray-sdk-psycopg2.8.patch"::"https://github.com/aws/aws-xray-sdk-python/commit/4b4422a3ad9bb9a28399b34851dd574f6155bb66.patch;
-
"aws-xray-sdk-pynamodb4.patch"::"https://github.com/aws/aws-xray-sdk-python/commit/1dd185ba2fb946cea711a9620f04516c7f6eecdf.patch;
-"$pkgname-botocore-1.13.patch")
-sha256sums=('e480a6dc21d314faf6a9af4cf871fd7b782fae1e704e0fe5977161707f101374'
-'b0740901e4c3bd0a678b217b1121c5f827e8535722a560d9f84fb9a8b90f8f74'
-'c2ad5a109841600d271c0b4b49b0fb2b54bcac6e220bf6a7c4cd6f68e17f377e'
-'f581fe077ed5484e95cf7a3dc651fc3a86bcac6a8fcd142d701edce01266412c')
+source=("https://github.com/aws/aws-xray-sdk-python/archive/$pkgver/$pkgname-$pkgver.tar.gz;)
+sha256sums=('adb528c7c092293613484ca28c5466c79889ff6035493681daf9fbde9ba95b3a')
 
-prepare() {
-  cd $_pkgname-$pkgver
-  patch -Np1 -i ../aws-xray-sdk-psycopg2.8.patch
-  # https://github.com/aws/aws-xray-sdk-python/issues/171
-  patch -Np1 -i ../aws-xray-sdk-pynamodb4.patch
-  # https://github.com/aws/aws-xray-sdk-python/pull/181
-  patch -Np1 -i ../$pkgname-botocore-1.13.patch
-}
-
 build() {
   cd $_pkgname-$pkgver
   python setup.py build

Deleted: python-aws-xray-sdk-botocore-1.13.patch
===
--- python-aws-xray-sdk-botocore-1.13.patch 2019-12-07 01:28:30 UTC (rev 
536131)
+++ python-aws-xray-sdk-botocore-1.13.patch 2019-12-07 03:21:12 UTC (rev 
536132)
@@ -1,80 +0,0 @@
-From a9fb17f9f9d9edd44a2eafc2add36607b2aff98a Mon Sep 17 00:00:00 2001
-From: Daniel Roschka 
-Date: Mon, 11 Nov 2019 10:30:52 +0100
-Subject: [PATCH 1/2] Fix patching for PynamoDB 4.x with botocore 1.13
-

- aws_xray_sdk/ext/pynamodb/patch.py | 11 ++-
- 1 file changed, 6 insertions(+), 5 deletions(-)
-
-diff --git a/aws_xray_sdk/ext/pynamodb/patch.py 
b/aws_xray_sdk/ext/pynamodb/patch.py
-index 74b7825..2be2d41 100644
 a/aws_xray_sdk/ext/pynamodb/patch.py
-+++ b/aws_xray_sdk/ext/pynamodb/patch.py
-@@ -1,4 +1,3 @@
--import botocore.vendored.requests.sessions
- import json
- import wrapt
- import pynamodb
-@@ -13,16 +12,18 @@
- def patch():
- """Patch PynamoDB so it generates subsegements when calling DynamoDB."""
- 
--if hasattr(botocore.vendored.requests.sessions, '_xray_enabled'):
--return
--setattr(botocore.vendored.requests.sessions, '_xray_enabled', True)
--
- if PYNAMODB4:
- module = 'botocore.httpsession'
- name = 'URLLib3Session.send'
- else:
-+import botocore.vendored.requests.sessions
-+if hasattr(botocore.vendored.requests.sessions, '_xray_enabled'):
-+return
-+setattr(botocore.vendored.requests.sessions, '_xray_enabled', True)
-+
- module = 'botocore.vendored.requests.sessions'
- name = 'Session.send'
-+
- wrapt.wrap_function_wrapper(
- module, name, _xray_traced_pynamodb,
- )
-
-From f1f8cd4e6635d1beb7c703717971afed54813a6a Mon Sep 17 00:00:00 2001
-From: Daniel Roschka 
-Date: Mon, 11 Nov 2019 13:17:37 +0100
-Subject: [PATCH 2/2] Make PynamoDB patching idempotent for PynamoDB 4
-

- aws_xray_sdk/ext/pynamodb/patch.py | 10 +-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/aws_xray_sdk/ext/pynamodb/patch.py 
b/aws_xray_sdk/ext/pynamodb/patch.py
-index 2be2d41..1478808 100644
 a/aws_xray_sdk/ext/pynamodb/patch.py
-+++ b/aws_xray_sdk/ext/pynamodb/patch.py
-@@ -8,15 +8,23 @@
- 
- PYNAMODB4 = int(pynamodb.__version__.split('.')[0]) >= 4
- 
-+if PYNAMODB4:
-+import botocore.httpsession
-+else:
-+import botocore.vendored.requests.sessions
-+
- 
- def patch():
- """Patch PynamoDB so it generates subsegements when calling DynamoDB."""
- 
- if 

[arch-commits] Commit in python-aws-xray-sdk/trunk (2 files)

2019-11-12 Thread Chih-Hsuan Yen via arch-commits
Date: Wednesday, November 13, 2019 @ 06:37:40
  Author: yan12125
Revision: 527082

upgpkg: python-aws-xray-sdk 2.4.2-7 - compatibility with botocore 1.13

The patch, which is from https://github.com/aws/aws-xray-sdk-python/pull/181,
is not merged yet. It looks good to me, so I added it to Arch Linux before
upstream actions.

Added:
  python-aws-xray-sdk/trunk/python-aws-xray-sdk-botocore-1.13.patch
Modified:
  python-aws-xray-sdk/trunk/PKGBUILD

-+
 PKGBUILD|   10 ++-
 python-aws-xray-sdk-botocore-1.13.patch |   80 ++
 2 files changed, 87 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2019-11-13 03:01:13 UTC (rev 527081)
+++ PKGBUILD2019-11-13 06:37:40 UTC (rev 527082)
@@ -4,7 +4,7 @@
 pkgname=python-aws-xray-sdk
 _pkgname=aws-xray-sdk-python
 pkgver=2.4.2
-pkgrel=6
+pkgrel=7
 pkgdesc='AWS X-Ray SDK for Python'
 arch=(any)
 url='https://github.com/aws/aws-xray-sdk-python'
@@ -17,10 +17,12 @@
 # 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;
 
"aws-xray-sdk-psycopg2.8.patch"::"https://github.com/aws/aws-xray-sdk-python/commit/4b4422a3ad9bb9a28399b34851dd574f6155bb66.patch;
-
"aws-xray-sdk-pynamodb4.patch"::"https://github.com/aws/aws-xray-sdk-python/commit/1dd185ba2fb946cea711a9620f04516c7f6eecdf.patch;)
+
"aws-xray-sdk-pynamodb4.patch"::"https://github.com/aws/aws-xray-sdk-python/commit/1dd185ba2fb946cea711a9620f04516c7f6eecdf.patch;
+"$pkgname-botocore-1.13.patch")
 sha256sums=('e480a6dc21d314faf6a9af4cf871fd7b782fae1e704e0fe5977161707f101374'
 'b0740901e4c3bd0a678b217b1121c5f827e8535722a560d9f84fb9a8b90f8f74'
-'c2ad5a109841600d271c0b4b49b0fb2b54bcac6e220bf6a7c4cd6f68e17f377e')
+'c2ad5a109841600d271c0b4b49b0fb2b54bcac6e220bf6a7c4cd6f68e17f377e'
+'f581fe077ed5484e95cf7a3dc651fc3a86bcac6a8fcd142d701edce01266412c')
 
 prepare() {
   cd $_pkgname-$pkgver
@@ -27,6 +29,8 @@
   patch -Np1 -i ../aws-xray-sdk-psycopg2.8.patch
   # https://github.com/aws/aws-xray-sdk-python/issues/171
   patch -Np1 -i ../aws-xray-sdk-pynamodb4.patch
+  # https://github.com/aws/aws-xray-sdk-python/pull/181
+  patch -Np1 -i ../$pkgname-botocore-1.13.patch
 }
 
 build() {

Added: python-aws-xray-sdk-botocore-1.13.patch
===
--- python-aws-xray-sdk-botocore-1.13.patch (rev 0)
+++ python-aws-xray-sdk-botocore-1.13.patch 2019-11-13 06:37:40 UTC (rev 
527082)
@@ -0,0 +1,80 @@
+From a9fb17f9f9d9edd44a2eafc2add36607b2aff98a Mon Sep 17 00:00:00 2001
+From: Daniel Roschka 
+Date: Mon, 11 Nov 2019 10:30:52 +0100
+Subject: [PATCH 1/2] Fix patching for PynamoDB 4.x with botocore 1.13
+
+---
+ aws_xray_sdk/ext/pynamodb/patch.py | 11 ++-
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/aws_xray_sdk/ext/pynamodb/patch.py 
b/aws_xray_sdk/ext/pynamodb/patch.py
+index 74b7825..2be2d41 100644
+--- a/aws_xray_sdk/ext/pynamodb/patch.py
 b/aws_xray_sdk/ext/pynamodb/patch.py
+@@ -1,4 +1,3 @@
+-import botocore.vendored.requests.sessions
+ import json
+ import wrapt
+ import pynamodb
+@@ -13,16 +12,18 @@
+ def patch():
+ """Patch PynamoDB so it generates subsegements when calling DynamoDB."""
+ 
+-if hasattr(botocore.vendored.requests.sessions, '_xray_enabled'):
+-return
+-setattr(botocore.vendored.requests.sessions, '_xray_enabled', True)
+-
+ if PYNAMODB4:
+ module = 'botocore.httpsession'
+ name = 'URLLib3Session.send'
+ else:
++import botocore.vendored.requests.sessions
++if hasattr(botocore.vendored.requests.sessions, '_xray_enabled'):
++return
++setattr(botocore.vendored.requests.sessions, '_xray_enabled', True)
++
+ module = 'botocore.vendored.requests.sessions'
+ name = 'Session.send'
++
+ wrapt.wrap_function_wrapper(
+ module, name, _xray_traced_pynamodb,
+ )
+
+From f1f8cd4e6635d1beb7c703717971afed54813a6a Mon Sep 17 00:00:00 2001
+From: Daniel Roschka 
+Date: Mon, 11 Nov 2019 13:17:37 +0100
+Subject: [PATCH 2/2] Make PynamoDB patching idempotent for PynamoDB 4
+
+---
+ aws_xray_sdk/ext/pynamodb/patch.py | 10 +-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/aws_xray_sdk/ext/pynamodb/patch.py 
b/aws_xray_sdk/ext/pynamodb/patch.py
+index 2be2d41..1478808 100644
+--- a/aws_xray_sdk/ext/pynamodb/patch.py
 b/aws_xray_sdk/ext/pynamodb/patch.py
+@@ -8,15 +8,23 @@
+ 
+ PYNAMODB4 = int(pynamodb.__version__.split('.')[0]) >= 4
+ 
++if PYNAMODB4:
++import botocore.httpsession
++else:
++import botocore.vendored.requests.sessions
++
+ 
+ def patch():
+ """Patch PynamoDB so it generates subsegements when calling 

[arch-commits] Commit in python-aws-xray-sdk/trunk (2 files)

2019-10-09 Thread Chih-Hsuan Yen via arch-commits
Date: Thursday, October 10, 2019 @ 02:48:02
  Author: yan12125
Revision: 514400

upgpkg: python-aws-xray-sdk 2.4.2-4

* The Pynamodb 4 PR [1] is merged, use that

[1] https://github.com/aws/aws-xray-sdk-python/pull/177

Modified:
  python-aws-xray-sdk/trunk/PKGBUILD
Deleted:
  python-aws-xray-sdk/trunk/aws-xray-sdk-pynamodb4.patch

--+
 PKGBUILD |6 +++---
 aws-xray-sdk-pynamodb4.patch |   24 
 2 files changed, 3 insertions(+), 27 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2019-10-10 02:42:30 UTC (rev 514399)
+++ PKGBUILD2019-10-10 02:48:02 UTC (rev 514400)
@@ -4,7 +4,7 @@
 pkgname=python-aws-xray-sdk
 _pkgname=aws-xray-sdk-python
 pkgver=2.4.2
-pkgrel=3
+pkgrel=4
 pkgdesc='AWS X-Ray SDK for Python'
 arch=(any)
 url='https://github.com/aws/aws-xray-sdk-python'
@@ -17,10 +17,10 @@
 # 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;
 
"aws-xray-sdk-psycopg2.8.patch"::"https://github.com/aws/aws-xray-sdk-python/commit/4b4422a3ad9bb9a28399b34851dd574f6155bb66.patch;
-"aws-xray-sdk-pynamodb4.patch")
+
"aws-xray-sdk-pynamodb4.patch"::"https://github.com/aws/aws-xray-sdk-python/commit/1dd185ba2fb946cea711a9620f04516c7f6eecdf.patch;)
 sha256sums=('e480a6dc21d314faf6a9af4cf871fd7b782fae1e704e0fe5977161707f101374'
 'b0740901e4c3bd0a678b217b1121c5f827e8535722a560d9f84fb9a8b90f8f74'
-'e894f6c30b00126cbf2023fdef5c774827a99e8450d4c79e8abfdabed2d2868b')
+'c2ad5a109841600d271c0b4b49b0fb2b54bcac6e220bf6a7c4cd6f68e17f377e')
 
 prepare() {
   cd $_pkgname-$pkgver

Deleted: aws-xray-sdk-pynamodb4.patch
===
--- aws-xray-sdk-pynamodb4.patch2019-10-10 02:42:30 UTC (rev 514399)
+++ aws-xray-sdk-pynamodb4.patch2019-10-10 02:48:02 UTC (rev 514400)
@@ -1,24 +0,0 @@
-diff --git a/aws_xray_sdk/ext/pynamodb/patch.py 
b/aws_xray_sdk/ext/pynamodb/patch.py
-index 8815cc3..a5e462f 100644
 a/aws_xray_sdk/ext/pynamodb/patch.py
-+++ b/aws_xray_sdk/ext/pynamodb/patch.py
-@@ -16,8 +16,8 @@ def patch():
- setattr(botocore.vendored.requests.sessions, '_xray_enabled', True)
- 
- wrapt.wrap_function_wrapper(
--'botocore.vendored.requests.sessions',
--'Session.send',
-+'botocore.httpsession',
-+'URLLib3Session.send',
- _xray_traced_pynamodb,
- )
- 
-@@ -59,7 +59,7 @@ def pynamodb_meta_processor(wrapped, instance, args, kwargs, 
return_value,
- subsegment.add_error_flag()
- subsegment.add_exception(exception, stack, True)
- 
--resp = return_value.json() if return_value else None
-+resp = json.loads(return_value.text) if return_value else None
- _extract_whitelisted_params(subsegment.name, operation_name, aws_meta,
- [None, 
json.loads(args[0].body.decode('utf-8'))],
- None, resp)


[arch-commits] Commit in python-aws-xray-sdk/trunk (2 files)

2019-08-17 Thread Chih-Hsuan Yen via arch-commits
Date: Saturday, August 17, 2019 @ 13:40:39
  Author: yan12125
Revision: 499978

upgpkg: python-aws-xray-sdk 2.4.2-3

Add a patch for PynamoDB 4.0 compatibility.

Kept in [community-testing] until that patch is reviewed.

Added:
  python-aws-xray-sdk/trunk/aws-xray-sdk-pynamodb4.patch
Modified:
  python-aws-xray-sdk/trunk/PKGBUILD

--+
 PKGBUILD |   10 +++---
 aws-xray-sdk-pynamodb4.patch |   24 
 2 files changed, 31 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2019-08-17 13:21:06 UTC (rev 499977)
+++ PKGBUILD2019-08-17 13:40:39 UTC (rev 499978)
@@ -4,7 +4,7 @@
 pkgname=python-aws-xray-sdk
 _pkgname=aws-xray-sdk-python
 pkgver=2.4.2
-pkgrel=2
+pkgrel=3
 pkgdesc='AWS X-Ray SDK for Python'
 arch=(any)
 url='https://github.com/aws/aws-xray-sdk-python'
@@ -16,13 +16,17 @@
   python-pg8000 python-requests python-aiobotocore)
 # 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;
-
"aws-xray-sdk-psycopg2.8.patch"::"https://github.com/aws/aws-xray-sdk-python/commit/4b4422a3ad9bb9a28399b34851dd574f6155bb66.patch;)
+
"aws-xray-sdk-psycopg2.8.patch"::"https://github.com/aws/aws-xray-sdk-python/commit/4b4422a3ad9bb9a28399b34851dd574f6155bb66.patch;
+"aws-xray-sdk-pynamodb4.patch")
 sha256sums=('e480a6dc21d314faf6a9af4cf871fd7b782fae1e704e0fe5977161707f101374'
-'b0740901e4c3bd0a678b217b1121c5f827e8535722a560d9f84fb9a8b90f8f74')
+'b0740901e4c3bd0a678b217b1121c5f827e8535722a560d9f84fb9a8b90f8f74'
+'e894f6c30b00126cbf2023fdef5c774827a99e8450d4c79e8abfdabed2d2868b')
 
 prepare() {
   cd $_pkgname-$pkgver
   patch -Np1 -i ../aws-xray-sdk-psycopg2.8.patch
+  # https://github.com/aws/aws-xray-sdk-python/issues/171
+  patch -Np1 -i ../aws-xray-sdk-pynamodb4.patch
 }
 
 build() {

Added: aws-xray-sdk-pynamodb4.patch
===
--- aws-xray-sdk-pynamodb4.patch(rev 0)
+++ aws-xray-sdk-pynamodb4.patch2019-08-17 13:40:39 UTC (rev 499978)
@@ -0,0 +1,24 @@
+diff --git a/aws_xray_sdk/ext/pynamodb/patch.py 
b/aws_xray_sdk/ext/pynamodb/patch.py
+index 8815cc3..a5e462f 100644
+--- a/aws_xray_sdk/ext/pynamodb/patch.py
 b/aws_xray_sdk/ext/pynamodb/patch.py
+@@ -16,8 +16,8 @@ def patch():
+ setattr(botocore.vendored.requests.sessions, '_xray_enabled', True)
+ 
+ wrapt.wrap_function_wrapper(
+-'botocore.vendored.requests.sessions',
+-'Session.send',
++'botocore.httpsession',
++'URLLib3Session.send',
+ _xray_traced_pynamodb,
+ )
+ 
+@@ -59,7 +59,7 @@ def pynamodb_meta_processor(wrapped, instance, args, kwargs, 
return_value,
+ subsegment.add_error_flag()
+ subsegment.add_exception(exception, stack, True)
+ 
+-resp = return_value.json() if return_value else None
++resp = json.loads(return_value.text) if return_value else None
+ _extract_whitelisted_params(subsegment.name, operation_name, aws_meta,
+ [None, 
json.loads(args[0].body.decode('utf-8'))],
+ None, resp)