Hello community, here is the log from the commit of package python-flask-restplus for openSUSE:Factory checked in at 2020-04-25 20:30:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flask-restplus (Old) and /work/SRC/openSUSE:Factory/.python-flask-restplus.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flask-restplus" Sat Apr 25 20:30:51 2020 rev:5 rq:796806 version:0.13.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-flask-restplus/python-flask-restplus.changes 2019-11-06 14:06:16.784796945 +0100 +++ /work/SRC/openSUSE:Factory/.python-flask-restplus.new.2738/python-flask-restplus.changes 2020-04-25 20:35:36.894924085 +0200 @@ -1,0 +2,8 @@ +Wed Apr 22 18:44:04 UTC 2020 - Petr Cervinka <p...@cervinka.net> + +- Fix build without python2 +- Add compatibility patches for werkzeug 1.0: + 001-Fix-content-type-assertion-for-werkzeug-1.0.patch + 002-Update-cached_property-import-for-werkzeug-1.0.patch + +------------------------------------------------------------------- New: ---- 001-Fix-content-type-assertion-for-werkzeug-1.0.patch 002-Update-cached_property-import-for-werkzeug-1.0.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flask-restplus.spec ++++++ --- /var/tmp/diff_new_pack.31KZnt/_old 2020-04-25 20:35:37.698925743 +0200 +++ /var/tmp/diff_new_pack.31KZnt/_new 2020-04-25 20:35:37.702925751 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-flask-restplus # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,6 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without test +%bcond_without python2 Name: python-flask-restplus Version: 0.13.0 Release: 0 @@ -27,6 +28,8 @@ URL: https://github.com/noirbizarre/flask-restplus Source: https://github.com/noirbizarre/flask-restplus/archive/%{version}.tar.gz Patch0: pytest4.patch +Patch1: 001-Fix-content-type-assertion-for-werkzeug-1.0.patch +Patch2: 002-Update-cached_property-import-for-werkzeug-1.0.patch BuildRequires: %{python_module Flask >= 0.8} BuildRequires: %{python_module aniso8601 >= 0.82} BuildRequires: %{python_module jsonschema} @@ -35,8 +38,10 @@ BuildRequires: %{python_module six >= 1.3.0} BuildRequires: fdupes BuildRequires: python-rpm-macros +%if %{with python2} BuildRequires: python2-enum34 BuildRequires: python2-ipaddress +%endif Requires: python-Flask >= 0.8 Requires: python-aniso8601 >= 0.82 Requires: python-jsonschema @@ -67,6 +72,8 @@ %prep %setup -q -n flask-restplus-%{version} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build %python_build ++++++ 001-Fix-content-type-assertion-for-werkzeug-1.0.patch ++++++ >From b05250604646754b3b812b8b1ee9e0260fbb3ade Mon Sep 17 00:00:00 2001 From: czerw <p...@cervinka.net> Date: Wed, 22 Apr 2020 18:36:32 +0200 Subject: [PATCH] Fix content type assertion for werkzeug 1.0 Werkzeug 1.0 changed content type to include "charset=utf-8". --- tests/test_errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_errors.py b/tests/test_errors.py index a4be922..61bafaa 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -386,7 +386,7 @@ class ErrorsTest(object): response = client.get("/foo") assert response.status_code == 404 - assert response.headers['Content-Type'] == 'text/html' + assert response.headers['Content-Type'] == 'text/html; charset=utf-8' def test_non_api_error_404_catchall(self, app, client): api = restplus.Api(app, catch_all_404s=True) -- 2.26.0 ++++++ 002-Update-cached_property-import-for-werkzeug-1.0.patch ++++++ >From 148e3a7a52e4963350c1dd138e58557f015223c4 Mon Sep 17 00:00:00 2001 From: czerw <p...@cervinka.net> Date: Wed, 22 Apr 2020 18:41:12 +0200 Subject: [PATCH] Update cached_property import for werkzeug 1.0 --- flask_restplus/api.py | 2 +- flask_restplus/fields.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flask_restplus/api.py b/flask_restplus/api.py index 3727650..a2fed69 100644 --- a/flask_restplus/api.py +++ b/flask_restplus/api.py @@ -21,7 +21,7 @@ from flask.signals import got_request_exception from jsonschema import RefResolver -from werkzeug import cached_property +from werkzeug.utils import cached_property from werkzeug.datastructures import Headers from werkzeug.exceptions import HTTPException, MethodNotAllowed, NotFound, NotAcceptable, InternalServerError from werkzeug.wrappers import BaseResponse diff --git a/flask_restplus/fields.py b/flask_restplus/fields.py index 7e75700..5bc96dc 100644 --- a/flask_restplus/fields.py +++ b/flask_restplus/fields.py @@ -14,7 +14,7 @@ from six import iteritems, itervalues, text_type, string_types from six.moves.urllib.parse import urlparse, urlunparse from flask import url_for, request -from werkzeug import cached_property +from werkzeug.utils import cached_property from .inputs import date_from_iso8601, datetime_from_iso8601, datetime_from_rfc822, boolean from .errors import RestError -- 2.26.0