summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-12-02 11:10:40 +0100
committerMichał Górny <mgorny@gentoo.org>2020-12-02 11:50:19 +0100
commit7f754153e019367b53e721d9d9430435124ea90d (patch)
tree8631a5ba885bb0fce436b544fa1fac1c07610f72 /dev-python/urllib3/files
parentdev-python/configobj: Stabilize 5.0.6-r1 arm64, #757435 (diff)
downloadgentoo-7f754153e019367b53e721d9d9430435124ea90d.tar.gz
gentoo-7f754153e019367b53e721d9d9430435124ea90d.tar.bz2
gentoo-7f754153e019367b53e721d9d9430435124ea90d.zip
dev-python/urllib3: Support dev-python/brotlicffi
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/urllib3/files')
-rw-r--r--dev-python/urllib3/files/urllib3-1.26.2-brotlicffi.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/dev-python/urllib3/files/urllib3-1.26.2-brotlicffi.patch b/dev-python/urllib3/files/urllib3-1.26.2-brotlicffi.patch
new file mode 100644
index 00000000000..b7cbf9bb7e9
--- /dev/null
+++ b/dev-python/urllib3/files/urllib3-1.26.2-brotlicffi.patch
@@ -0,0 +1,65 @@
+From 14bcf7004a143f7a6fb2df9a48196a113d531f50 Mon Sep 17 00:00:00 2001
+From: Seth Michael Larson <sethmichaellarson@gmail.com>
+Date: Tue, 1 Dec 2020 20:09:32 -0600
+Subject: [PATCH] Switch to Brotli C bindings for CPython, brotlicffi for
+ non-CPython
+
+---
+ setup.cfg | 3 ++-
+ setup.py | 5 ++++-
+ src/urllib3/response.py | 5 ++++-
+ src/urllib3/util/request.py | 5 ++++-
+ 7 files changed, 16 insertions(+), 18 deletions(-)
+
+diff --git a/setup.cfg b/setup.cfg
+index 90b79d8c5..31a465b58 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -15,7 +15,7 @@ requires-dist =
+ idna>=2.0.0; extra == 'secure'
+ certifi; extra == 'secure'
+ PySocks>=1.5.6,<2.0,!=1.5.7; extra == 'socks'
+- brotlipy>=0.6.0; extra == 'brotli'
++ brotlicffi>=0.8.0; extra == 'brotli'
+
+ [tool:pytest]
+ xfail_strict = true
+diff --git a/setup.py b/setup.py
+index 2d449b095..02071aa58 100755
+--- a/setup.py
++++ b/setup.py
+@@ -109,7 +109,7 @@
+ requires=[],
+ python_requires=">=3.6, <4",
+ extras_require={
+- "brotli": ["brotlipy>=0.6.0"],
++ "brotli": ["brotlicffi>=0.8.0"],
+ "secure": [
+ "pyOpenSSL>=0.14",
+ "cryptography>=1.3.4",
+diff --git a/src/urllib3/response.py b/src/urllib3/response.py
+index 77b6ffc16..d277120ee 100644
+--- a/src/urllib3/response.py
++++ b/src/urllib3/response.py
+@@ -7,7 +7,7 @@
+ from socket import timeout as SocketTimeout
+
+ try:
+- import brotli
++ import brotlicffi as brotli
+ except ImportError:
+ brotli = None
+
+diff --git a/src/urllib3/util/request.py b/src/urllib3/util/request.py
+index 6cbdad9b4..64d40641d 100644
+--- a/src/urllib3/util/request.py
++++ b/src/urllib3/util/request.py
+@@ -11,7 +11,7 @@
+
+ ACCEPT_ENCODING = "gzip,deflate"
+ try:
+- import brotli as _unused_module_brotli # noqa: F401
++ import brotlicffi as _unused_module_brotli # noqa: F401
+ except ImportError:
+ pass
+ else: