Skip to content

Commit 59b8755

Browse files
committed
Address CI failures and warnings
1 parent a67e61d commit 59b8755

File tree

6 files changed

+30
-18
lines changed

6 files changed

+30
-18
lines changed

docs-requirements.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ exceptiongroup >= 1.0.0rc9
2323
immutables >= 0.6
2424

2525
# types used in annotations
26-
# TODO: fix support for importing typing-extensions
27-
pyOpenSSL < 25.0.0
26+
pyOpenSSL

docs-requirements.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pycparser==2.22 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
5555
# via cffi
5656
pygments==2.19.1
5757
# via sphinx
58-
pyopenssl==24.3.0
58+
pyopenssl==25.0.0
5959
# via -r docs-requirements.in
6060
requests==2.32.3
6161
# via sphinx
@@ -105,6 +105,8 @@ sphinxcontrib-trio==1.1.2
105105
towncrier==24.8.0
106106
# via -r docs-requirements.in
107107
typing-extensions==4.12.2
108-
# via beautifulsoup4
108+
# via
109+
# beautifulsoup4
110+
# pyopenssl
109111
urllib3==2.3.0
110112
# via requests

docs/source/conf.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
from pathlib import Path
2626
from typing import TYPE_CHECKING, cast
2727

28+
from sphinx.util.inventory import _InventoryItem
29+
2830
if TYPE_CHECKING:
2931
from sphinx.application import Sphinx
3032
from sphinx.util.typing import Inventory
@@ -266,11 +268,11 @@ def add_mapping(
266268
assert isinstance(inventory, dict)
267269
inventory = cast("Inventory", inventory)
268270

269-
inventory[f"py:{reftype}"][f"{target}"] = (
270-
"Python",
271-
version,
272-
f"https://docs.python.org/{url_version}/library/{library}.html/{obj}",
273-
"-",
271+
inventory[f"py:{reftype}"][f"{target}"] = _InventoryItem(
272+
project_name="Python",
273+
project_version=version,
274+
uri=f"https://docs.python.org/{url_version}/library/{library}.html/{obj}",
275+
display_name="-",
274276
)
275277

276278
# This has been removed in Py3.12, so add a link to the 3.11 version with deprecation warnings.

docs/source/contributing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ format all our code to a standard style. While you're editing code you
318318
can be as sloppy as you like about whitespace; and then before you commit,
319319
just run:
320320

321-
.. code-block::
321+
.. code-block:: text
322322
323323
pip install -U pre-commit
324324
pre-commit
@@ -332,14 +332,14 @@ nicely formatted. (black doesn't reformat comments or docstrings.)
332332
If you would like, you can even have pre-commit run before you commit by
333333
running:
334334

335-
.. code-block::
335+
.. code-block:: text
336336
337337
pre-commit install
338338
339339
and now pre-commit will run before git commits. You can uninstall the
340340
pre-commit hook at any time by running:
341341

342-
.. code-block::
342+
.. code-block:: text
343343
344344
pre-commit uninstall
345345
@@ -349,7 +349,7 @@ you can can add ``# fmt: off`` and ``# fmt: on`` comments.
349349

350350
If you want to see what changes black will make, you can use:
351351

352-
.. code-block::
352+
.. code-block:: text
353353
354354
black --diff trio
355355
@@ -433,7 +433,7 @@ file to install all of the required packages (possibly using a
433433
virtualenv). After that, build the docs using ``make html`` in the
434434
docs directory. The whole process might look something like this:
435435

436-
.. code-block::
436+
.. code-block:: text
437437
438438
cd path/to/project/checkout/
439439
pip install -r docs-requirements.txt

src/trio/testing/_memory_streams.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,15 @@ def put_eof(self) -> None:
280280
self._incoming.close()
281281

282282

283+
# TODO: investigate why this is necessary for the docs
284+
MemorySendStream.__module__ = MemorySendStream.__module__.replace(
285+
"._memory_streams", ""
286+
)
287+
MemoryReceiveStream.__module__ = MemoryReceiveStream.__module__.replace(
288+
"._memory_streams", ""
289+
)
290+
291+
283292
def memory_stream_pump(
284293
memory_send_stream: MemorySendStream,
285294
memory_receive_stream: MemoryReceiveStream,

src/trio/testing/_raises_group.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class Matcher(AbstractMatcher[MatchE]):
270270
271271
Examples::
272272
273-
with RaisesGroups(Matcher(ValueError, match="string"))
273+
with RaisesGroups(Matcher(ValueError, match="string")):
274274
...
275275
with RaisesGroups(Matcher(check=lambda x: x.args == (3, "hello"))):
276276
...
@@ -326,7 +326,7 @@ def matches(
326326
327327
Examples::
328328
329-
assert Matcher(ValueError).matches(my_exception):
329+
assert Matcher(ValueError).matches(my_exception)
330330
# is equivalent to
331331
assert isinstance(my_exception, ValueError)
332332
@@ -336,7 +336,7 @@ def matches(
336336
assert Matcher(SyntaxError, match="foo").matches(excinfo.value.__cause__)
337337
# above line is equivalent to
338338
assert isinstance(excinfo.value.__cause__, SyntaxError)
339-
assert re.search("foo", str(excinfo.value.__cause__)
339+
assert re.search("foo", str(excinfo.value.__cause__))
340340
341341
"""
342342
if not self._check_type(exception):
@@ -549,7 +549,7 @@ def __init__(
549549
)
550550
self.allow_unwrapped = allow_unwrapped
551551
self.flatten_subgroups: bool = flatten_subgroups
552-
self.is_baseexceptiongroup = False
552+
self.is_baseexceptiongroup: bool = False
553553

554554
if allow_unwrapped and other_exceptions:
555555
raise ValueError(

0 commit comments

Comments
 (0)