From 7a3966f61667cc4544b4b5fabff7a7c75065142ebdfa652bb27c78c49293138c Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 12 Apr 2022 23:11:11 +0000 Subject: [PATCH 1/2] Accepting request 969571 from home:bnavigator:branches:devel:languages:python:flask - Truncate werkzeug.patch as Flask changed their behavior back to returning relative URLs. - Update fix-setup-py.patch accordingly - Update _service file (rerun modifies the archive, but keeps same tag) OBS-URL: https://build.opensuse.org/request/show/969571 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpbin?expand=0&rev=20 --- _service | 2 +- fix-setup-py.patch | 4 +- ...n-httpbin-0.7.0+git20181107.f8ec666.tar.xz | 4 +- python-httpbin.changes | 9 ++++ python-httpbin.spec | 10 +++-- werkzeug.patch | 42 ------------------- 6 files changed, 21 insertions(+), 50 deletions(-) diff --git a/_service b/_service index b84f71d..23914e1 100644 --- a/_service +++ b/_service @@ -1,7 +1,7 @@ python-httpbin - git://github.com/postmanlabs/httpbin.git + https://github.com/postmanlabs/httpbin.git git enable 0.7.0+git%cd.%h diff --git a/fix-setup-py.patch b/fix-setup-py.patch index cbf01ce..e81092f 100644 --- a/fix-setup-py.patch +++ b/fix-setup-py.patch @@ -8,7 +8,7 @@ Index: python-httpbin-0.7.0+git20181107.f8ec666/setup.py install_requires=[ - 'Flask', 'MarkupSafe', 'decorator', 'itsdangerous', 'six', 'brotlipy', - 'raven[flask]', 'werkzeug>=0.14.1', 'gevent', 'flasgger' -+ 'Flask', 'MarkupSafe', 'decorator', 'itsdangerous', 'six', 'brotli', -+ 'werkzeug>=0.14.1', 'gevent', 'flasgger' ++ 'Flask>=2.1', 'MarkupSafe', 'decorator', 'itsdangerous', 'six', 'brotli', ++ 'werkzeug>=2.0', 'gevent', 'flasgger' ], ) diff --git a/python-httpbin-0.7.0+git20181107.f8ec666.tar.xz b/python-httpbin-0.7.0+git20181107.f8ec666.tar.xz index 2247d81..fa67ec8 100644 --- a/python-httpbin-0.7.0+git20181107.f8ec666.tar.xz +++ b/python-httpbin-0.7.0+git20181107.f8ec666.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ab0787e72373f6f4f01fed6ee7521c75aa9c4dfc17a584a7770f286d5bedd256 -size 97964 +oid sha256:6ca690b5d5d0b1e75a947559663400492c48be4713502f9466da658d4270f638 +size 98088 diff --git a/python-httpbin.changes b/python-httpbin.changes index a309ab6..a2025f0 100644 --- a/python-httpbin.changes +++ b/python-httpbin.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Apr 12 20:36:37 UTC 2022 - Ben Greiner + +- Truncate werkzeug.patch as Flask changed their behavior back to + returning relative URLs. +- Update fix-setup-py.patch accordingly +- Update _service file (rerun modifies the archive, but keeps same + tag) + ------------------------------------------------------------------- Tue Mar 15 04:57:06 UTC 2022 - Steve Kowalik diff --git a/python-httpbin.spec b/python-httpbin.spec index 7a2f75a..2b15714 100644 --- a/python-httpbin.spec +++ b/python-httpbin.spec @@ -17,6 +17,8 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +# The PyPI version is 0.7.0 but the metadata reads an internal file with version 0.9.2 +%define internalversion 0.9.2 Name: python-httpbin Version: 0.7.0+git20181107.f8ec666 Release: 0 @@ -30,7 +32,7 @@ Patch0: werkzeug.patch # Based on https://github.com/postmanlabs/httpbin/pull/553 Patch1: fix-setup-py.patch BuildRequires: %{python_module Brotli} -BuildRequires: %{python_module Flask} +BuildRequires: %{python_module Flask >= 2.1} BuildRequires: %{python_module MarkupSafe} BuildRequires: %{python_module Werkzeug >= 2.0} BuildRequires: %{python_module blinker} @@ -43,7 +45,7 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Brotli -Requires: python-Flask +Requires: python-Flask >= 2.1 Requires: python-MarkupSafe Requires: python-Werkzeug >= 2.0 Requires: python-blinker @@ -67,6 +69,7 @@ All endpoint responses are JSON-encoded. %prep %autosetup -p1 +chmod -x httpbin/templates/forms-post.html %build export LANG=en_US.UTF-8 @@ -83,6 +86,7 @@ export LANG=en_US.UTF-8 %files %{python_files} %doc README.md %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/httpbin +%{python_sitelib}/httpbin-%{internalversion}*-info %changelog diff --git a/werkzeug.patch b/werkzeug.patch index 84d5fbf..d369db0 100644 --- a/werkzeug.patch +++ b/werkzeug.patch @@ -32,45 +32,3 @@ Index: python-httpbin-0.7.0+git20181107.f8ec666/test_httpbin.py self.assertEqual(data['url'], 'http://localhost/anything/foo/bar') self.assertEqual(data['method'], 'GET') self.assertTrue(response.data.endswith(b'\n')) -@@ -586,7 +584,7 @@ class HttpbinTestCase(unittest.TestCase) - def test_redirect_n_higher_than_1(self): - response = self.app.get('/redirect/5') - self.assertEqual( -- response.headers.get('Location'), '/relative-redirect/4' -+ response.headers.get('Location'), 'http://localhost/relative-redirect/4' - ) - - def test_redirect_to_post(self): -@@ -595,7 +593,7 @@ class HttpbinTestCase(unittest.TestCase) - content_type='application/octet-stream') - self.assertEqual(response.status_code, 307) - self.assertEqual( -- response.headers.get('Location'), '/post' -+ response.headers.get('Location'), 'http://localhost/post' - ) - - def test_redirect_absolute_param_n_higher_than_1(self): -@@ -608,20 +606,20 @@ class HttpbinTestCase(unittest.TestCase) - response = self.app.get('/redirect/1') - self.assertEqual(response.status_code, 302) - self.assertEqual( -- response.headers.get('Location'), '/get' -+ response.headers.get('Location'), 'http://localhost/get' - ) - - def test_relative_redirect_n_equals_to_1(self): - response = self.app.get('/relative-redirect/1') - self.assertEqual( -- response.headers.get('Location'), '/get' -+ response.headers.get('Location'), 'http://localhost/get' - ) - - def test_relative_redirect_n_higher_than_1(self): - response = self.app.get('/relative-redirect/7') - self.assertEqual(response.status_code, 302) - self.assertEqual( -- response.headers.get('Location'), '/relative-redirect/6' -+ response.headers.get('Location'), 'http://localhost/relative-redirect/6' - ) - - def test_absolute_redirect_n_higher_than_1(self): From 3a514142a2747f2b9430df00bfe6ef39b76c668b579e67e45f05877ee687a08d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 23 Apr 2022 09:31:42 +0000 Subject: [PATCH 2/2] Accepting request 972239 from home:bnavigator:branches:devel:languages:python - add httpbin-pr674-wekzeug2.1.patch for Werkzeug 2.1 compatibility gh#postmanlabs/httpbin#674 OBS-URL: https://build.opensuse.org/request/show/972239 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpbin?expand=0&rev=21 --- httpbin-pr674-wekzeug2.1.patch | 32 ++++++++++++++++++++++++++++++++ python-httpbin.changes | 6 ++++++ python-httpbin.spec | 6 ++++-- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 httpbin-pr674-wekzeug2.1.patch diff --git a/httpbin-pr674-wekzeug2.1.patch b/httpbin-pr674-wekzeug2.1.patch new file mode 100644 index 0000000..5696f4c --- /dev/null +++ b/httpbin-pr674-wekzeug2.1.patch @@ -0,0 +1,32 @@ +From 5cc81ce87a3c447a127e4a1a707faf9f3b1c9b6b Mon Sep 17 00:00:00 2001 +From: Maximino BOGADO +Date: Wed, 30 Mar 2022 16:26:31 +0200 +Subject: [PATCH] Replace BaseResponse to Response class (new werkzeug version + 2.1.0) + +--- + httpbin/core.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/httpbin/core.py b/httpbin/core.py +index 305c9882..2bad408e 100644 +--- a/httpbin/core.py ++++ b/httpbin/core.py +@@ -29,7 +29,7 @@ + from six.moves import range as xrange + from werkzeug.datastructures import WWWAuthenticate, MultiDict + from werkzeug.http import http_date +-from werkzeug.wrappers import BaseResponse ++from werkzeug.wrappers import Response + from werkzeug.http import parse_authorization_header + from flasgger import Swagger, NO_SANITIZER + +@@ -77,7 +77,7 @@ def jsonify(*args, **kwargs): + + + # Prevent WSGI from correcting the casing of the Location header +-BaseResponse.autocorrect_location_header = False ++Response.autocorrect_location_header = False + + # Find the correct template folder when running from a different location + tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates") diff --git a/python-httpbin.changes b/python-httpbin.changes index a2025f0..c09b088 100644 --- a/python-httpbin.changes +++ b/python-httpbin.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 22 19:17:15 UTC 2022 - Ben Greiner + +- add httpbin-pr674-wekzeug2.1.patch for Werkzeug 2.1 compatibility + gh#postmanlabs/httpbin#674 + ------------------------------------------------------------------- Tue Apr 12 20:36:37 UTC 2022 - Ben Greiner diff --git a/python-httpbin.spec b/python-httpbin.spec index 2b15714..c5db519 100644 --- a/python-httpbin.spec +++ b/python-httpbin.spec @@ -27,10 +27,12 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/Runscope/httpbin Source: python-httpbin-%{version}.tar.xz -# https://github.com/postmanlabs/httpbin/pull/555 +# PATCH-FIX-UPSTREAM werkzeug.patch -- gh#postmanlabs/httpbin#555 Patch0: werkzeug.patch -# Based on https://github.com/postmanlabs/httpbin/pull/553 +# PATCH-FIX-UPSTREAM fix-setup-py.patch -- gh#postmanlabs/httpbin#553 Patch1: fix-setup-py.patch +# PATCH-FIX-UPSTREAM httpbin-pr674-wekzeug2.1.patch -- gh#postmanlabs/httpbin#674 +Patch2: httpbin-pr674-wekzeug2.1.patch BuildRequires: %{python_module Brotli} BuildRequires: %{python_module Flask >= 2.1} BuildRequires: %{python_module MarkupSafe}