Skip to content

Commit 5d25e15

Browse files
committed
cffi version works with python-hyper/brotlicffi#214
1 parent 0ca4536 commit 5d25e15

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

CHANGES/11898.breaking.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Support for ``brotlicffi`` has been removed until the required features are supported by that library -- by :user:`Dreamsorcerer`.
1+
``Brotli`` and ``brotlicffi`` minimum version is now 1.2 -- by :user:`Dreamsorcerer`.

aiohttp/compression_utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
Buffer = Union[bytes, bytearray, "memoryview[int]", "memoryview[bytes]"]
1414

1515
try:
16-
# brotlicffi won't work until they create a 1.2 release.
17-
# try:
18-
# import brotlicffi as brotli
19-
# except ImportError:
20-
import brotli
16+
try:
17+
import brotlicffi as brotli
18+
except ImportError:
19+
import brotli
2120

2221
HAS_BROTLI = True
2322
except ImportError:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dynamic = [
5050
speedups = [
5151
"aiodns >= 3.3.0",
5252
"Brotli >= 1.2; platform_python_implementation == 'CPython'",
53-
#"brotlicffi; platform_python_implementation != 'CPython'",
53+
"brotlicffi >= 1.2; platform_python_implementation != 'CPython'",
5454
"backports.zstd; platform_python_implementation == 'CPython' and python_version < '3.14'",
5555
]
5656

requirements/runtime-deps.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ aiosignal >= 1.4.0
66
async-timeout >= 4.0, < 6.0 ; python_version < '3.11'
77
backports.zstd; platform_python_implementation == 'CPython' and python_version < '3.14'
88
Brotli >= 1.2; platform_python_implementation == 'CPython'
9+
brotlicffi >= 1.2; platform_python_implementation != 'CPython'
910
frozenlist >= 1.1.1
1011
multidict >=4.5, < 7.0
1112
propcache >= 0.2.0

tests/test_http_parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
from aiohttp.http_writer import HttpVersion
3131

3232
try:
33-
# try:
34-
# import brotlicffi as brotli
35-
# except ImportError:
36-
import brotli
33+
try:
34+
import brotlicffi as brotli
35+
except ImportError:
36+
import brotli
3737
except ImportError:
3838
brotli = None
3939

tests/test_web_functional.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
from typing import NoReturn
99
from unittest import mock
1010

11-
# try:
12-
# import brotlicffi as brotli
13-
# except ImportError:
14-
import brotli
11+
try:
12+
import brotlicffi as brotli
13+
except ImportError:
14+
import brotli
1515
import pytest
1616
from multidict import CIMultiDictProxy, MultiDict
1717
from pytest_mock import MockerFixture

tests/test_web_sendfile_functional.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
from typing import NoReturn, Protocol
88
from unittest import mock
99

10-
# try:
11-
# import brotlicffi as brotli
12-
# except ImportError:
13-
import brotli
10+
try:
11+
import brotlicffi as brotli
12+
except ImportError:
13+
import brotli
1414
import pytest
1515
from _pytest.fixtures import SubRequest
1616

0 commit comments

Comments
 (0)