Date: Monday, December 6, 2021 @ 21:44:40 Author: foutrelis Revision: 1065396
Add compat fix for pyjwt 2.0.0 Added: python-flask-jwt/trunk/pyjwt-2.0.0.patch Modified: python-flask-jwt/trunk/PKGBUILD -------------------+ PKGBUILD | 15 ++++++++++----- pyjwt-2.0.0.patch | 24 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2021-12-06 21:44:17 UTC (rev 1065395) +++ PKGBUILD 2021-12-06 21:44:40 UTC (rev 1065396) @@ -10,14 +10,19 @@ depends=('python-flask' 'python-pyjwt') makedepends=('python-setuptools') checkdepends=('python-pytest-runner') -source=("$pkgname-$pkgver.tar.gz::https://github.com/mattupstate/flask-jwt/archive/$pkgver.tar.gz") -sha512sums=('7c115ff4964da9a36303ac502dea98cd847abc3c1d45cd0be09b82ec761ee054d7ef97e25fd669112ab29dbfca00b4563914155ab1c8da4fc3d32f0063128b26') +source=("$pkgname-$pkgver.tar.gz::https://github.com/mattupstate/flask-jwt/archive/$pkgver.tar.gz" + pyjwt-2.0.0.patch) +sha512sums=('7c115ff4964da9a36303ac502dea98cd847abc3c1d45cd0be09b82ec761ee054d7ef97e25fd669112ab29dbfca00b4563914155ab1c8da4fc3d32f0063128b26' + '4ec0a901263ac39bdb204bb684413617a5e1250536b07d03eb89fe489c58492b1960be0d3c429f908ea71e782563c0c3c6fcd76ec40fa7ae829c9a772355ed7f') prepare() { + cd flask-jwt-$pkgver + # https://github.com/mattupstate/flask-jwt/issues/143 + patch -Np1 -i ../pyjwt-2.0.0.patch # Too old options - sed -i 's/,<1.5.0//' flask-jwt-$pkgver/requirements.txt - echo > flask-jwt-$pkgver/requirements-dev.txt - rm flask-jwt-$pkgver/setup.cfg + sed -i 's/,<1.5.0//' requirements.txt + echo > requirements-dev.txt + rm setup.cfg } build() { Added: pyjwt-2.0.0.patch =================================================================== --- pyjwt-2.0.0.patch (rev 0) +++ pyjwt-2.0.0.patch 2021-12-06 21:44:40 UTC (rev 1065396) @@ -0,0 +1,24 @@ +diff -upr flask-jwt-0.3.2.orig/flask_jwt/__init__.py flask-jwt-0.3.2/flask_jwt/__init__.py +--- flask-jwt-0.3.2.orig/flask_jwt/__init__.py 2015-11-03 16:41:38.000000000 +0200 ++++ flask-jwt-0.3.2/flask_jwt/__init__.py 2021-12-06 23:38:24.755653892 +0200 +@@ -129,7 +129,7 @@ def _default_auth_request_handler(): + + + def _default_auth_response_handler(access_token, identity): +- return jsonify({'access_token': access_token.decode('utf-8')}) ++ return jsonify({'access_token': access_token}) + + + def _default_jwt_error_handler(error): +diff -upr flask-jwt-0.3.2.orig/tests/test_jwt.py flask-jwt-0.3.2/tests/test_jwt.py +--- flask-jwt-0.3.2.orig/tests/test_jwt.py 2015-11-03 16:41:38.000000000 +0200 ++++ flask-jwt-0.3.2/tests/test_jwt.py 2021-12-06 23:38:31.295817131 +0200 +@@ -193,7 +193,7 @@ def test_custom_error_handler(client, jw + def test_custom_response_handler(client, jwt, user): + @jwt.auth_response_handler + def resp_handler(access_token, identity): +- return jsonify({'mytoken': access_token.decode('utf-8')}) ++ return jsonify({'mytoken': access_token}) + + resp, jdata = post_json( + client, '/auth', {'username': user.username, 'password': user.password})