commit: bce18f25da9def0bc03a6c5a354c85c3badd6e4f Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Thu Apr 7 09:09:55 2022 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Thu Apr 7 09:12:53 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bce18f25
dev-python/httpbin: Fix compat with werkzeug-2.1 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> .../httpbin/files/httpbin-0.7.0-werkzeug-2.1.patch | 32 ++++++++++++++++++++++ dev-python/httpbin/httpbin-0.7.0-r4.ebuild | 9 ++++-- ...bin-0.7.0-r4.ebuild => httpbin-0.7.0-r5.ebuild} | 20 +++++++++----- 3 files changed, 51 insertions(+), 10 deletions(-) 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 new file mode 100644 index 000000000000..cf7871268d99 --- /dev/null +++ b/dev-python/httpbin/files/httpbin-0.7.0-werkzeug-2.1.patch @@ -0,0 +1,32 @@ +From 5cc81ce87a3c447a127e4a1a707faf9f3b1c9b6b Mon Sep 17 00:00:00 2001 +From: Maximino BOGADO <[email protected]> +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/dev-python/httpbin/httpbin-0.7.0-r4.ebuild b/dev-python/httpbin/httpbin-0.7.0-r4.ebuild index df999b5429a0..7750896348d1 100644 --- a/dev-python/httpbin/httpbin-0.7.0-r4.ebuild +++ b/dev-python/httpbin/httpbin-0.7.0-r4.ebuild @@ -9,8 +9,10 @@ PYTHON_COMPAT=( python3_{8..10} pypy3 ) inherit distutils-r1 DESCRIPTION="HTTP Request and Response Service" -HOMEPAGE="https://github.com/postmanlabs/httpbin - https://pypi.org/project/httpbin/" +HOMEPAGE=" + https://github.com/postmanlabs/httpbin/ + https://pypi.org/project/httpbin/ +" SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" LICENSE="MIT" @@ -24,7 +26,8 @@ RDEPEND=" dev-python/itsdangerous[${PYTHON_USEDEP}] dev-python/markupsafe[${PYTHON_USEDEP}] dev-python/six[${PYTHON_USEDEP}] - >=dev-python/werkzeug-0.14.1[${PYTHON_USEDEP}]" + <dev-python/werkzeug-2.1[${PYTHON_USEDEP}] +" PATCHES=( # do not import raven if it's not going to be used diff --git a/dev-python/httpbin/httpbin-0.7.0-r4.ebuild b/dev-python/httpbin/httpbin-0.7.0-r5.ebuild similarity index 71% copy from dev-python/httpbin/httpbin-0.7.0-r4.ebuild copy to dev-python/httpbin/httpbin-0.7.0-r5.ebuild index df999b5429a0..83c8c6aab6f8 100644 --- a/dev-python/httpbin/httpbin-0.7.0-r4.ebuild +++ b/dev-python/httpbin/httpbin-0.7.0-r5.ebuild @@ -9,13 +9,15 @@ PYTHON_COMPAT=( python3_{8..10} pypy3 ) inherit distutils-r1 DESCRIPTION="HTTP Request and Response Service" -HOMEPAGE="https://github.com/postmanlabs/httpbin - https://pypi.org/project/httpbin/" +HOMEPAGE=" + https://github.com/postmanlabs/httpbin/ + https://pypi.org/project/httpbin/ +" SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" LICENSE="MIT" SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos" +KEYWORDS="~amd64 ~arm ~arm64 ~m68k ~riscv ~x86" RDEPEND=" dev-python/brotlicffi[${PYTHON_USEDEP}] @@ -24,16 +26,20 @@ RDEPEND=" dev-python/itsdangerous[${PYTHON_USEDEP}] dev-python/markupsafe[${PYTHON_USEDEP}] dev-python/six[${PYTHON_USEDEP}] - >=dev-python/werkzeug-0.14.1[${PYTHON_USEDEP}]" + >=dev-python/werkzeug-2.0[${PYTHON_USEDEP}] +" PATCHES=( # do not import raven if it's not going to be used # (upstream removed it completely in git anyway) - "${FILESDIR}"/httpbin-0.7.0-optional-raven.patch + "${FILESDIR}"/${P}-optional-raven.patch # fix tests with new versions of werkzeug - "${FILESDIR}"/httpbin-0.7.0-test-werkzeug.patch + "${FILESDIR}"/${P}-test-werkzeug.patch # use brotlicffi instead of brotlipy - "${FILESDIR}"/httpbin-0.7.0-brotlicffi.patch + "${FILESDIR}"/${P}-brotlicffi.patch + # fix compat with werkzeug 2.1 + # https://github.com/postmanlabs/httpbin/pull/674 + "${FILESDIR}"/${P}-werkzeug-2.1.patch ) distutils_enable_tests unittest
