From 0a044f75b54d92417debf600fe7c4c4f86af344d Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 16 Mar 2020 03:55:16 +0100 Subject: gnu: python-flask-restful: Update to 0.3.8. * gnu/packages/patches/python-flask-restful-werkzeug-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/python-web.scm (python-flask-restful): Update to 0.3.8. [source](patches): New field. [native-inputs]: Remove PYTHON-SPHINX. --- .../python-flask-restful-werkzeug-compat.patch | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 gnu/packages/patches/python-flask-restful-werkzeug-compat.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/python-flask-restful-werkzeug-compat.patch b/gnu/packages/patches/python-flask-restful-werkzeug-compat.patch new file mode 100644 index 0000000000..0e928ef455 --- /dev/null +++ b/gnu/packages/patches/python-flask-restful-werkzeug-compat.patch @@ -0,0 +1,36 @@ +We need one patch on top of 0.3.8 for compatibility with Werkzeug 1.0. + +Taken from upstream: +https://github.com/flask-restful/flask-restful/commit/73376a488907af3042b52678ac4c23f8a8911e5b + +diff --git a/tests/test_api.py b/tests/test_api.py +index f7f8e661..6795d362 100644 +--- a/tests/test_api.py ++++ b/tests/test_api.py +@@ -445,7 +445,9 @@ def test_handle_non_api_error(self): + + resp = app.get("/foo") + self.assertEquals(resp.status_code, 404) +- self.assertEquals('text/html', resp.headers['Content-Type']) ++ # in newer versions of werkzeug this is `text/html; charset=utf8` ++ content_type, _, _ = resp.headers['Content-Type'].partition(';') ++ self.assertEquals('text/html', content_type) + + def test_non_api_error_404_catchall(self): + app = Flask(__name__) +diff --git a/tests/test_reqparse.py b/tests/test_reqparse.py +index 2f1fbedf..9776f17c 100644 +--- a/tests/test_reqparse.py ++++ b/tests/test_reqparse.py +@@ -2,9 +2,9 @@ + import unittest + from mock import Mock, patch + from flask import Flask +-from werkzeug import exceptions, MultiDict ++from werkzeug import exceptions + from werkzeug.wrappers import Request +-from werkzeug.datastructures import FileStorage ++from werkzeug.datastructures import FileStorage, MultiDict + from flask_restful.reqparse import Argument, RequestParser, Namespace + import six + import decimal -- cgit 1.4.1