Skip to content

Commit 37e3186

Browse files
ci: Remove brotli from requirements-testing.txt (#6614)
Remove the package from `requirements-testing.txt` and add it only as a dependency of the test suites that rely on it. This is part of environment cleanup before moving the remaining testing dependencies to a uv dependency group.
1 parent 32d24bf commit 37e3186

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

requirements-testing.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ pysocks
1111
socksio
1212
httpcore[http2]
1313
setuptools
14-
Brotli
1514
docker

scripts/populate_tox/tox.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ deps =
7979

8080
# === Common ===
8181
py3.8-common: hypothesis
82+
common: brotli
8283
common: pytest-asyncio
8384
common: httpcore[asyncio]
8485
# See https://github.com/pytest-dev/pytest/issues/9621
@@ -97,6 +98,7 @@ deps =
9798
# for justification of the upper bound on pytest
9899
{py3.6,py3.7}-gevent: pytest<7.0.0
99100
{py3.8,py3.9,py3.10,py3.11,py3.12}-gevent: pytest
101+
gevent: brotli
100102
gevent: pytest-asyncio
101103
gevent: setuptools<82
102104
{py3.10,py3.11}-gevent: zope.event<5.0.0

tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
from unittest import mock
1414
from urllib.parse import parse_qs, urlparse
1515

16-
import brotli
16+
try:
17+
import brotli
18+
except ImportError:
19+
brotli = None
20+
1721
import jsonschema
1822
import pytest
1923
from pytest_localserver.http import WSGIServer
@@ -1641,6 +1645,7 @@ def __call__(self, environ, start_response):
16411645
rdr = gzip.GzipFile(fileobj=io.BytesIO(request.data))
16421646
compressed = True
16431647
elif content_encoding == "br":
1648+
assert brotli is not None
16441649
rdr = io.BytesIO(brotli.decompress(request.data))
16451650
compressed = True
16461651
else:

tox.ini

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)