From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 582FD13835D for ; Sat, 19 Jun 2021 12:01:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 92853E083D; Sat, 19 Jun 2021 12:01:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6A67DE083D for ; Sat, 19 Jun 2021 12:01:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 935AE340BBD for ; Sat, 19 Jun 2021 12:01:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E492373A for ; Sat, 19 Jun 2021 12:01:35 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1624104084.449b6535e1bc097415f34b1930b24c843960015d.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/aiohttp/files/, dev-python/aiohttp/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/aiohttp/aiohttp-3.7.4-r1.ebuild dev-python/aiohttp/aiohttp-3.7.4.ebuild dev-python/aiohttp/files/aiohttp-3.7.4-brotli.patch X-VCS-Directories: dev-python/aiohttp/files/ dev-python/aiohttp/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 449b6535e1bc097415f34b1930b24c843960015d X-VCS-Branch: master Date: Sat, 19 Jun 2021 12:01:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 71ef9d79-c421-490a-bb8f-28165077b6aa X-Archives-Hash: 60e04bdf2b2e9b2c61de6630f5e299b8 commit: 449b6535e1bc097415f34b1930b24c843960015d Author: Michał Górny gentoo org> AuthorDate: Sat Jun 19 11:15:34 2021 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Jun 19 12:01:24 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=449b6535 dev-python/aiohttp: Backport the switch to app-arch/brotli Signed-off-by: Michał Górny gentoo.org> ...iohttp-3.7.4.ebuild => aiohttp-3.7.4-r1.ebuild} | 8 +- .../aiohttp/files/aiohttp-3.7.4-brotli.patch | 97 ++++++++++++++++++++++ 2 files changed, 103 insertions(+), 2 deletions(-) diff --git a/dev-python/aiohttp/aiohttp-3.7.4.ebuild b/dev-python/aiohttp/aiohttp-3.7.4-r1.ebuild similarity index 95% rename from dev-python/aiohttp/aiohttp-3.7.4.ebuild rename to dev-python/aiohttp/aiohttp-3.7.4-r1.ebuild index f90f64776cf..d35289bb49a 100644 --- a/dev-python/aiohttp/aiohttp-3.7.4.ebuild +++ b/dev-python/aiohttp/aiohttp-3.7.4-r1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{7..9} ) +PYTHON_COMPAT=( python3_{8..9} ) inherit distutils-r1 multiprocessing @@ -27,8 +27,8 @@ BDEPEND=" dev-python/cython[${PYTHON_USEDEP}] test? ( !!dev-python/pytest-aiohttp + app-arch/brotli[python,${PYTHON_USEDEP}] dev-python/async_generator[${PYTHON_USEDEP}] - dev-python/brotlipy[${PYTHON_USEDEP}] dev-python/freezegun[${PYTHON_USEDEP}] www-servers/gunicorn[${PYTHON_USEDEP}] dev-python/pytest-forked[${PYTHON_USEDEP}] @@ -40,6 +40,10 @@ BDEPEND=" ) " +PATCHES=( + "${FILESDIR}"/aiohttp-3.7.4-brotli.patch +) + DOCS=( CHANGES.rst CONTRIBUTORS.txt README.rst ) distutils_enable_tests pytest diff --git a/dev-python/aiohttp/files/aiohttp-3.7.4-brotli.patch b/dev-python/aiohttp/files/aiohttp-3.7.4-brotli.patch new file mode 100644 index 00000000000..1e8add00799 --- /dev/null +++ b/dev-python/aiohttp/files/aiohttp-3.7.4-brotli.patch @@ -0,0 +1,97 @@ +From a7424ddf490fc51244d427543cc9683b5427102b Mon Sep 17 00:00:00 2001 +From: Felix Yan +Date: Fri, 19 Jul 2019 21:32:55 +0800 +Subject: [PATCH] Use Brotli instead of brotlipy (#3803) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +brotlipy is stuck at brotli 0.6 and upstream is inactive. Let's switch +to the official binding which is up-to-date. + +(rebased for 3.7.x by Michał Górny) +--- + aiohttp/http_parser.py | 25 +++++++++++++++++++++---- + docs/client_quickstart.rst | 2 +- + docs/index.rst | 2 +- + setup.py | 2 +- + 4 files changed, 24 insertions(+), 7 deletions(-) + +diff --git a/aiohttp/http_parser.py b/aiohttp/http_parser.py +index 71ba815a..56ecead4 100644 +--- a/aiohttp/http_parser.py ++++ b/aiohttp/http_parser.py +@@ -821,10 +821,27 @@ class DeflateBuffer: + if encoding == "br": + if not HAS_BROTLI: # pragma: no cover + raise ContentEncodingError( +- "Can not decode content-encoding: brotli (br). " +- "Please install `brotlipy`" +- ) +- self.decompressor = brotli.Decompressor() ++ 'Can not decode content-encoding: brotli (br). ' ++ 'Please install `Brotli`') ++ ++ class BrotliDecoder: ++ # Supports both 'brotlipy' and 'Brotli' packages ++ # since they share an import name. The top branches ++ # are for 'brotlipy' and bottom branches for 'Brotli' ++ def __init__(self) -> None: ++ self._obj = brotli.Decompressor() ++ ++ def decompress(self, data: bytes) -> bytes: ++ if hasattr(self._obj, "decompress"): ++ return self._obj.decompress(data) ++ return self._obj.process(data) ++ ++ def flush(self) -> bytes: ++ if hasattr(self._obj, "flush"): ++ return self._obj.flush() ++ return b"" ++ ++ self.decompressor = BrotliDecoder() # type: Any + else: + zlib_mode = 16 + zlib.MAX_WBITS if encoding == "gzip" else zlib.MAX_WBITS + self.decompressor = zlib.decompressobj(wbits=zlib_mode) +diff --git a/docs/client_quickstart.rst b/docs/client_quickstart.rst +index 95588cb6..b9146584 100644 +--- a/docs/client_quickstart.rst ++++ b/docs/client_quickstart.rst +@@ -174,7 +174,7 @@ The ``gzip`` and ``deflate`` transfer-encodings are automatically + decoded for you. + + You can enable ``brotli`` transfer-encodings support, +-just install `brotlipy `_. ++just install `Brotli `_. + + JSON Request + ============ +diff --git a/docs/index.rst b/docs/index.rst +index 13fe723b..4091c001 100644 +--- a/docs/index.rst ++++ b/docs/index.rst +@@ -52,7 +52,7 @@ Installing speedups altogether + ------------------------------ + + The following will get you ``aiohttp`` along with :term:`chardet`, +-:term:`aiodns` and ``brotlipy`` in one bundle. No need to type ++:term:`aiodns` and ``Brotli`` in one bundle. No need to type + separate commands anymore! + + .. code-block:: bash +diff --git a/setup.py b/setup.py +index 54462ba7..7a184817 100644 +--- a/setup.py ++++ b/setup.py +@@ -137,7 +137,7 @@ args = dict( + extras_require={ + "speedups": [ + "aiodns", +- "brotlipy", ++ "Brotli", + "cchardet", + ], + }, +-- +2.32.0 +