1 |
commit: e00d74a7cb0bec8ffcfb1b73afdd1e7ca68f809e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 2 09:45:52 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 2 09:51:01 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e00d74a7 |
7 |
|
8 |
dev-python/httpbin: Support dev-python/brotlicffi |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
.../httpbin/files/httpbin-0.7.0-brotlicffi.patch | 43 ++++++++++++++++++++++ |
13 |
dev-python/httpbin/httpbin-0.7.0-r2.ebuild | 38 +++++++++++++++++++ |
14 |
2 files changed, 81 insertions(+) |
15 |
|
16 |
diff --git a/dev-python/httpbin/files/httpbin-0.7.0-brotlicffi.patch b/dev-python/httpbin/files/httpbin-0.7.0-brotlicffi.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..f74474a70aa |
19 |
--- /dev/null |
20 |
+++ b/dev-python/httpbin/files/httpbin-0.7.0-brotlicffi.patch |
21 |
@@ -0,0 +1,43 @@ |
22 |
+From 69d1e62e69b7f886ebbb41b8e9aae62e76adf375 Mon Sep 17 00:00:00 2001 |
23 |
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
24 |
+Date: Wed, 2 Dec 2020 10:42:52 +0100 |
25 |
+Subject: [PATCH] Replace brotlipy with brotlicffi |
26 |
+ |
27 |
+The brotlipy package has been renamed to brotlicffi. Update the imports |
28 |
+and dependencies accordingly. The major advanage of the new package |
29 |
+is that it no longer collides with the Python bindings provided |
30 |
+by brotli itself. |
31 |
+--- |
32 |
+ httpbin/filters.py | 2 +- |
33 |
+ setup.py | 2 +- |
34 |
+ 3 files changed, 3 insertions(+), 3 deletions(-) |
35 |
+ |
36 |
+diff --git a/httpbin/filters.py b/httpbin/filters.py |
37 |
+index c6268b6..4deeaaa 100644 |
38 |
+--- a/httpbin/filters.py |
39 |
++++ b/httpbin/filters.py |
40 |
+@@ -10,7 +10,7 @@ This module provides response filter decorators. |
41 |
+ import gzip as gzip2 |
42 |
+ import zlib |
43 |
+ |
44 |
+-import brotli as _brotli |
45 |
++import brotlicffi as _brotli |
46 |
+ |
47 |
+ from six import BytesIO |
48 |
+ from decimal import Decimal |
49 |
+diff --git a/setup.py b/setup.py |
50 |
+index 7f9956b..8e17ef3 100644 |
51 |
+--- a/setup.py |
52 |
++++ b/setup.py |
53 |
+@@ -34,7 +34,7 @@ setup( |
54 |
+ packages=find_packages(), |
55 |
+ include_package_data = True, # include files listed in MANIFEST.in |
56 |
+ install_requires=[ |
57 |
+- 'Flask', 'MarkupSafe', 'decorator', 'itsdangerous', 'six', 'brotlipy', |
58 |
++ 'Flask', 'MarkupSafe', 'decorator', 'itsdangerous', 'six', 'brotlicffi', |
59 |
+ 'raven[flask]', 'werkzeug>=0.14.1' |
60 |
+ ], |
61 |
+ ) |
62 |
+-- |
63 |
+2.29.2 |
64 |
+ |
65 |
|
66 |
diff --git a/dev-python/httpbin/httpbin-0.7.0-r2.ebuild b/dev-python/httpbin/httpbin-0.7.0-r2.ebuild |
67 |
new file mode 100644 |
68 |
index 00000000000..c498e61cfdb |
69 |
--- /dev/null |
70 |
+++ b/dev-python/httpbin/httpbin-0.7.0-r2.ebuild |
71 |
@@ -0,0 +1,38 @@ |
72 |
+# Copyright 1999-2020 Gentoo Authors |
73 |
+# Distributed under the terms of the GNU General Public License v2 |
74 |
+ |
75 |
+EAPI=7 |
76 |
+ |
77 |
+PYTHON_COMPAT=( python3_{6..9} pypy3 ) |
78 |
+ |
79 |
+inherit distutils-r1 |
80 |
+ |
81 |
+DESCRIPTION="HTTP Request and Response Service" |
82 |
+HOMEPAGE="https://github.com/postmanlabs/httpbin |
83 |
+ https://pypi.org/project/httpbin/" |
84 |
+SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" |
85 |
+ |
86 |
+LICENSE="MIT" |
87 |
+SLOT="0" |
88 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos" |
89 |
+ |
90 |
+RDEPEND=" |
91 |
+ dev-python/brotlicffi[${PYTHON_USEDEP}] |
92 |
+ dev-python/decorator[${PYTHON_USEDEP}] |
93 |
+ dev-python/flask[${PYTHON_USEDEP}] |
94 |
+ dev-python/itsdangerous[${PYTHON_USEDEP}] |
95 |
+ dev-python/markupsafe[${PYTHON_USEDEP}] |
96 |
+ dev-python/six[${PYTHON_USEDEP}] |
97 |
+ >=dev-python/werkzeug-0.14.1[${PYTHON_USEDEP}]" |
98 |
+ |
99 |
+PATCHES=( |
100 |
+ # do not import raven if it's not going to be used |
101 |
+ # (upstream removed it completely in git anyway) |
102 |
+ "${FILESDIR}"/httpbin-0.7.0-optional-raven.patch |
103 |
+ # fix tests with new versions of werkzeug |
104 |
+ "${FILESDIR}"/httpbin-0.7.0-test-werkzeug.patch |
105 |
+ # use brotlicffi instead of brotlipy |
106 |
+ "${FILESDIR}"/httpbin-0.7.0-brotlicffi.patch |
107 |
+) |
108 |
+ |
109 |
+distutils_enable_tests unittest |