summaryrefslogtreecommitdiff
path: root/dev-python/aiohttp
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-20 14:45:01 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-20 14:45:01 +0100
commit34dea8e38f88007799629d0a56b12dec480b1d21 (patch)
tree6790873994b58030360328cf5897d934b3b03d16 /dev-python/aiohttp
parent7932d472a02d4c016ff7dff4b7a5479ab9d1883d (diff)
gentoo resync : 20.06.2021
Diffstat (limited to 'dev-python/aiohttp')
-rw-r--r--dev-python/aiohttp/Manifest3
-rw-r--r--dev-python/aiohttp/aiohttp-3.7.4-r1.ebuild (renamed from dev-python/aiohttp/aiohttp-3.7.4.ebuild)51
-rw-r--r--dev-python/aiohttp/files/aiohttp-3.7.4-brotli.patch97
3 files changed, 130 insertions, 21 deletions
diff --git a/dev-python/aiohttp/Manifest b/dev-python/aiohttp/Manifest
index 8363340b4045..2dd0ca3e7a7e 100644
--- a/dev-python/aiohttp/Manifest
+++ b/dev-python/aiohttp/Manifest
@@ -1,3 +1,4 @@
+AUX aiohttp-3.7.4-brotli.patch 3537 BLAKE2B dfb410aabbd24f16bb1cf5fe999e9730417ccaf7ea59cb48d0445abcfe757e0b9d165ea723152df8f54ff039ac092a0a6cc6d6bddfebcad44d8d63f4eb5c3c79 SHA512 6bf8969c57fc649f84dae9eacd79d5f13558bc970e8755dbf22dcc08789d2377d1f04a745becd3c533f3a6ceb459ddb6bab5eb39e1098468650b312c2ecd51c3
DIST aiohttp-3.7.4.tar.gz 1114533 BLAKE2B dcae3e66e13df8264d731a3ca65b4718feca8d0e6e1baeb6608dcb9bfb4bd4baaed6bd34297ed5ece78d01189bf9a0b9860845cae4e2b93cc2ba463cc35cfb77 SHA512 66fcc837b388020dc998cbaa2db31e48ecec75bcfaa8af9108e2ea265588dafa5684ca96a8fe3ad6759b22e09a4ae6d4efd8653fb76126eccdc826c15cbbe2e6
-EBUILD aiohttp-3.7.4.ebuild 2564 BLAKE2B ae2a5c1737817fb6f34de4919c5669c1498415007b707d109a1f1b7a9183bdbec4be6fa1564563a28844ea656dcf88e06ad6fed266e800ba5dedd4421fbe5b0a SHA512 7c69ebee9ea38b252c165112a774d55ac3ef9431a647bff55c494b114063a8532a1934eafabb3f5d383f75640dfd8afc58bd371338e0a7d5ab3fcfe118d1ded5
+EBUILD aiohttp-3.7.4-r1.ebuild 3165 BLAKE2B 251953a98d2342392985e53c878a59177b75b032b9e443757c0c1195688b6a5bb2dd19fa0c66d4aaf2b583a8a460419eb6699f2dd2232f9d7e6f4de039b3c31d SHA512 c20675a6e456b7fb1ea0125e2c51fe7399ac466759c9f1b91e10364a667784605a8ae6e50a61c42f541030f6162c7397468513acdf163ac8d5ddf26ca284f946
MISC metadata.xml 489 BLAKE2B beb80da34848dfe7b81ed65d75923480644ecf42e2c5ce04a7f66f3e729651fdc6035054482aff966ec9f03cfbb812d3be0afd783af69e37f1002182e4885473 SHA512 d8c9e2edb8a57a3b6b02bb5314aef77dc266af6e80fd0300eb0652c59790232017d0062f5b7361b059c382d1c904f0f46cd0e672d1963e9595f3d4dc7514f182
diff --git a/dev-python/aiohttp/aiohttp-3.7.4.ebuild b/dev-python/aiohttp/aiohttp-3.7.4-r1.ebuild
index f90f64776cf1..3871075876e4 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
@@ -53,21 +57,6 @@ distutils_enable_sphinx docs \
'dev-python/sphinx-aiohttp-theme'
python_prepare_all() {
- # Fails due to a warning
- sed -e 's:test_read_boundary_with_incomplete_chunk:_&:' \
- -i tests/test_multipart.py || die
- # with py3.7+
- sed -e 's:test_aiohttp_request_coroutine:_&:' \
- -i tests/test_client_functional.py || die
-
- # Fails due to path mismatch
- sed -e 's:test_static:_&:' \
- -i tests/test_route_def.py || die
-
- # Internet
- sed -e 's:test_mark_formdata_as_processed:_&:' \
- -i tests/test_formdata.py || die
-
# newer chardet works too
sed -e 's|chardet>=2.0,<4.0|chardet>=2.0|' \
-i setup.py aiohttp.egg-info/requires.txt || die
@@ -79,10 +68,32 @@ python_prepare_all() {
}
python_test() {
+ local deselect=(
+ # fails with a 'runtime warning'
+ 'tests/test_client_functional.py::test_aiohttp_request_coroutine[pyloop]'
+
+ # fragile to test paths
+ tests/test_route_def.py::test_static
+
+ # requires Internet
+ tests/test_formdata.py::test_mark_formdata_as_processed
+
+ # 'Event loop is closed' -- probably broken by old age
+ 'tests/test_streams.py::TestDataQueue::test_read[pyloop]'
+ 'tests/test_streams.py::TestDataQueue::test_read_eof[pyloop]'
+ 'tests/test_streams.py::TestDataQueue::test_read_cancelled[pyloop]'
+ 'tests/test_streams.py::TestDataQueue::test_read_until_eof[pyloop]'
+ 'tests/test_streams.py::TestDataQueue::test_read_exc[pyloop]'
+ 'tests/test_streams.py::TestDataQueue::test_read_exception[pyloop]'
+ 'tests/test_streams.py::TestDataQueue::test_read_exception_with_data[pyloop]'
+ 'tests/test_streams.py::TestDataQueue::test_read_exception_on_wait[pyloop]'
+ 'tests/test_streams.py::TestDataQueue::test_exception_waiter[pyloop]'
+ )
+
pushd "${BUILD_DIR}/lib" >/dev/null || die
ln -snf "${S}"/{LICENSE.txt,tests} . || die
- pytest -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")" --forked \
- -vv tests || die "Tests fail with ${EPYTHON}"
- rm -rf .pytest_cache tests || die
+ epytest -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")" --forked \
+ ${deselect[@]/#/--deselect } tests
+ rm -rf .hypothesis .pytest_cache tests || die
popd >/dev/null || die
}
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 000000000000..1e8add007999
--- /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 <felixonmars@archlinux.org>
+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 <https://github.com/python-hyper/brotlipy>`_.
++just install `Brotli <https://pypi.org/project/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
+