1 |
commit: bce18f25da9def0bc03a6c5a354c85c3badd6e4f |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 7 09:09:55 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 7 09:12:53 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bce18f25 |
7 |
|
8 |
dev-python/httpbin: Fix compat with werkzeug-2.1 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
.../httpbin/files/httpbin-0.7.0-werkzeug-2.1.patch | 32 ++++++++++++++++++++++ |
13 |
dev-python/httpbin/httpbin-0.7.0-r4.ebuild | 9 ++++-- |
14 |
...bin-0.7.0-r4.ebuild => httpbin-0.7.0-r5.ebuild} | 20 +++++++++----- |
15 |
3 files changed, 51 insertions(+), 10 deletions(-) |
16 |
|
17 |
diff --git a/dev-python/httpbin/files/httpbin-0.7.0-werkzeug-2.1.patch b/dev-python/httpbin/files/httpbin-0.7.0-werkzeug-2.1.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..cf7871268d99 |
20 |
--- /dev/null |
21 |
+++ b/dev-python/httpbin/files/httpbin-0.7.0-werkzeug-2.1.patch |
22 |
@@ -0,0 +1,32 @@ |
23 |
+From 5cc81ce87a3c447a127e4a1a707faf9f3b1c9b6b Mon Sep 17 00:00:00 2001 |
24 |
+From: Maximino BOGADO <bogamax2@×××××××.fr> |
25 |
+Date: Wed, 30 Mar 2022 16:26:31 +0200 |
26 |
+Subject: [PATCH] Replace BaseResponse to Response class (new werkzeug version |
27 |
+ 2.1.0) |
28 |
+ |
29 |
+--- |
30 |
+ httpbin/core.py | 4 ++-- |
31 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
32 |
+ |
33 |
+diff --git a/httpbin/core.py b/httpbin/core.py |
34 |
+index 305c9882..2bad408e 100644 |
35 |
+--- a/httpbin/core.py |
36 |
++++ b/httpbin/core.py |
37 |
+@@ -29,7 +29,7 @@ |
38 |
+ from six.moves import range as xrange |
39 |
+ from werkzeug.datastructures import WWWAuthenticate, MultiDict |
40 |
+ from werkzeug.http import http_date |
41 |
+-from werkzeug.wrappers import BaseResponse |
42 |
++from werkzeug.wrappers import Response |
43 |
+ from werkzeug.http import parse_authorization_header |
44 |
+ from flasgger import Swagger, NO_SANITIZER |
45 |
+ |
46 |
+@@ -77,7 +77,7 @@ def jsonify(*args, **kwargs): |
47 |
+ |
48 |
+ |
49 |
+ # Prevent WSGI from correcting the casing of the Location header |
50 |
+-BaseResponse.autocorrect_location_header = False |
51 |
++Response.autocorrect_location_header = False |
52 |
+ |
53 |
+ # Find the correct template folder when running from a different location |
54 |
+ tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates") |
55 |
|
56 |
diff --git a/dev-python/httpbin/httpbin-0.7.0-r4.ebuild b/dev-python/httpbin/httpbin-0.7.0-r4.ebuild |
57 |
index df999b5429a0..7750896348d1 100644 |
58 |
--- a/dev-python/httpbin/httpbin-0.7.0-r4.ebuild |
59 |
+++ b/dev-python/httpbin/httpbin-0.7.0-r4.ebuild |
60 |
@@ -9,8 +9,10 @@ PYTHON_COMPAT=( python3_{8..10} pypy3 ) |
61 |
inherit distutils-r1 |
62 |
|
63 |
DESCRIPTION="HTTP Request and Response Service" |
64 |
-HOMEPAGE="https://github.com/postmanlabs/httpbin |
65 |
- https://pypi.org/project/httpbin/" |
66 |
+HOMEPAGE=" |
67 |
+ https://github.com/postmanlabs/httpbin/ |
68 |
+ https://pypi.org/project/httpbin/ |
69 |
+" |
70 |
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" |
71 |
|
72 |
LICENSE="MIT" |
73 |
@@ -24,7 +26,8 @@ RDEPEND=" |
74 |
dev-python/itsdangerous[${PYTHON_USEDEP}] |
75 |
dev-python/markupsafe[${PYTHON_USEDEP}] |
76 |
dev-python/six[${PYTHON_USEDEP}] |
77 |
- >=dev-python/werkzeug-0.14.1[${PYTHON_USEDEP}]" |
78 |
+ <dev-python/werkzeug-2.1[${PYTHON_USEDEP}] |
79 |
+" |
80 |
|
81 |
PATCHES=( |
82 |
# do not import raven if it's not going to be used |
83 |
|
84 |
diff --git a/dev-python/httpbin/httpbin-0.7.0-r4.ebuild b/dev-python/httpbin/httpbin-0.7.0-r5.ebuild |
85 |
similarity index 71% |
86 |
copy from dev-python/httpbin/httpbin-0.7.0-r4.ebuild |
87 |
copy to dev-python/httpbin/httpbin-0.7.0-r5.ebuild |
88 |
index df999b5429a0..83c8c6aab6f8 100644 |
89 |
--- a/dev-python/httpbin/httpbin-0.7.0-r4.ebuild |
90 |
+++ b/dev-python/httpbin/httpbin-0.7.0-r5.ebuild |
91 |
@@ -9,13 +9,15 @@ PYTHON_COMPAT=( python3_{8..10} pypy3 ) |
92 |
inherit distutils-r1 |
93 |
|
94 |
DESCRIPTION="HTTP Request and Response Service" |
95 |
-HOMEPAGE="https://github.com/postmanlabs/httpbin |
96 |
- https://pypi.org/project/httpbin/" |
97 |
+HOMEPAGE=" |
98 |
+ https://github.com/postmanlabs/httpbin/ |
99 |
+ https://pypi.org/project/httpbin/ |
100 |
+" |
101 |
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" |
102 |
|
103 |
LICENSE="MIT" |
104 |
SLOT="0" |
105 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos" |
106 |
+KEYWORDS="~amd64 ~arm ~arm64 ~m68k ~riscv ~x86" |
107 |
|
108 |
RDEPEND=" |
109 |
dev-python/brotlicffi[${PYTHON_USEDEP}] |
110 |
@@ -24,16 +26,20 @@ RDEPEND=" |
111 |
dev-python/itsdangerous[${PYTHON_USEDEP}] |
112 |
dev-python/markupsafe[${PYTHON_USEDEP}] |
113 |
dev-python/six[${PYTHON_USEDEP}] |
114 |
- >=dev-python/werkzeug-0.14.1[${PYTHON_USEDEP}]" |
115 |
+ >=dev-python/werkzeug-2.0[${PYTHON_USEDEP}] |
116 |
+" |
117 |
|
118 |
PATCHES=( |
119 |
# do not import raven if it's not going to be used |
120 |
# (upstream removed it completely in git anyway) |
121 |
- "${FILESDIR}"/httpbin-0.7.0-optional-raven.patch |
122 |
+ "${FILESDIR}"/${P}-optional-raven.patch |
123 |
# fix tests with new versions of werkzeug |
124 |
- "${FILESDIR}"/httpbin-0.7.0-test-werkzeug.patch |
125 |
+ "${FILESDIR}"/${P}-test-werkzeug.patch |
126 |
# use brotlicffi instead of brotlipy |
127 |
- "${FILESDIR}"/httpbin-0.7.0-brotlicffi.patch |
128 |
+ "${FILESDIR}"/${P}-brotlicffi.patch |
129 |
+ # fix compat with werkzeug 2.1 |
130 |
+ # https://github.com/postmanlabs/httpbin/pull/674 |
131 |
+ "${FILESDIR}"/${P}-werkzeug-2.1.patch |
132 |
) |
133 |
|
134 |
distutils_enable_tests unittest |