Skip to content

Commit 200b221

Browse files
authored
Merge branch 'python-trio:main' into pre-commit-tests-sync
2 parents aed1deb + d65d3f6 commit 200b221

32 files changed

+637
-67
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ jobs:
427427
run: >-
428428
echo "version=$(python -V | cut -d' ' -f2 | cut -d'.' -f1,2)"
429429
>> "${GITHUB_OUTPUT}"
430+
431+
- run: |
432+
coverage combine
433+
coverage report
434+
430435
- if: always()
431436
uses: codecov/codecov-action@v5
432437
with:

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.11.2
27+
rev: v0.11.4
2828
hooks:
2929
- id: ruff
3030
types: [file]
@@ -66,7 +66,7 @@ repos:
6666
additional_dependencies: ["pyyaml"]
6767
files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$
6868
- repo: https://github.com/astral-sh/uv-pre-commit
69-
rev: 0.6.11
69+
rev: 0.6.13
7070
hooks:
7171
# Compile requirements
7272
- id: pip-compile

docs-requirements.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ sphinx_rtd_theme >= 3
77
sphinxcontrib-jquery
88
sphinxcontrib-trio
99
towncrier
10-
sphinx-hoverxref
1110
sphinx-codeautolink
1211

1312
# Trio's own dependencies

docs-requirements.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,11 @@ sphinx==8.2.3
7373
# via
7474
# -r docs-requirements.in
7575
# sphinx-codeautolink
76-
# sphinx-hoverxref
7776
# sphinx-rtd-theme
7877
# sphinxcontrib-jquery
7978
# sphinxcontrib-trio
8079
sphinx-codeautolink==0.17.4
8180
# via -r docs-requirements.in
82-
sphinx-hoverxref==1.4.2
83-
# via -r docs-requirements.in
8481
sphinx-rtd-theme==3.0.2
8582
# via -r docs-requirements.in
8683
sphinxcontrib-applehelp==2.0.0
@@ -92,7 +89,6 @@ sphinxcontrib-htmlhelp==2.1.0
9289
sphinxcontrib-jquery==4.1
9390
# via
9491
# -r docs-requirements.in
95-
# sphinx-hoverxref
9692
# sphinx-rtd-theme
9793
sphinxcontrib-jsmath==1.0.1
9894
# via sphinx

docs/source/conf.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ def autodoc_process_signature(
171171
# currently undocumented things
172172
logger = getLogger("trio")
173173
UNDOCUMENTED = {
174-
"trio.CancelScope.relative_deadline",
175174
"trio.MemorySendChannel",
176175
"trio.MemoryReceiveChannel",
177176
"trio.MemoryChannelStatistics",
@@ -201,7 +200,9 @@ def autodoc_process_docstring(
201200
logger.warning(f"{name} has no docstring")
202201
else:
203202
if name in UNDOCUMENTED:
204-
logger.warning("outdated list of undocumented things")
203+
logger.warning(
204+
f"outdated list of undocumented things in docs/source/conf.py: {name!r} has a docstring"
205+
)
205206

206207

207208
def setup(app: Sphinx) -> None:
@@ -233,7 +234,6 @@ def setup(app: Sphinx) -> None:
233234
"sphinx.ext.napoleon",
234235
"sphinxcontrib_trio",
235236
"sphinxcontrib.jquery",
236-
"hoverxref.extension",
237237
"sphinx_codeautolink",
238238
"local_customization",
239239
"typevars",
@@ -248,24 +248,6 @@ def setup(app: Sphinx) -> None:
248248
"flake8-async": ("https://flake8-async.readthedocs.io/en/latest/", None),
249249
}
250250

251-
# See https://sphinx-hoverxref.readthedocs.io/en/latest/configuration.html
252-
hoverxref_auto_ref = True
253-
hoverxref_domains = ["py"]
254-
# Set the default style (tooltip) for all types to silence logging.
255-
# See https://github.com/readthedocs/sphinx-hoverxref/issues/211
256-
hoverxref_role_types = {
257-
"attr": "tooltip",
258-
"class": "tooltip",
259-
"const": "tooltip",
260-
"exc": "tooltip",
261-
"func": "tooltip",
262-
"meth": "tooltip",
263-
"mod": "tooltip",
264-
"obj": "tooltip",
265-
"ref": "tooltip",
266-
"data": "tooltip",
267-
}
268-
269251
# See https://sphinx-codeautolink.readthedocs.io/en/latest/reference.html#configuration
270252
codeautolink_autodoc_inject = False
271253
codeautolink_global_preface = """

docs/source/history.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ Release history
55

66
.. towncrier release notes start
77
8+
Trio 0.30.0 (2025-04-20)
9+
------------------------
10+
11+
Features
12+
~~~~~~~~
13+
14+
- Add :func:`@trio.as_safe_channel <trio.as_safe_channel>`, a wrapper that can be used to make async generators safe.
15+
This will be the suggested fix for the flake8-async lint rule `ASYNC900 <https://flake8-async.readthedocs.io/en/latest/rules.html#async900>`_. (`#3197 <https://github.com/python-trio/trio/issues/3197>`__)
16+
17+
18+
Bugfixes
19+
~~~~~~~~
20+
21+
- Allow `trio` to be a `types.ModuleType` and still have deprecated attributes. (`#2135 <https://github.com/python-trio/trio/issues/2135>`__)
22+
- Fixed socket module for some older systems which lack ``socket.AI_NUMERICSERV``.
23+
Now trio works on legacy (pre-Lion) macOS. (`#3133 <https://github.com/python-trio/trio/issues/3133>`__)
24+
- Update type hints for `trio.run_process` and `trio.lowlevel.open_process`. (`#3183 <https://github.com/python-trio/trio/issues/3183>`__)
25+
- Don't mutate the global runner when MockClock is created. (`#3205 <https://github.com/python-trio/trio/issues/3205>`__)
26+
- Fix incorrect return type hint for :meth:`Nursery.start() <trio.Nursery.start>`. (`#3224 <https://github.com/python-trio/trio/issues/3224>`__)
27+
28+
29+
Improved documentation
30+
~~~~~~~~~~~~~~~~~~~~~~
31+
32+
- Update wording in documentation to more accurately reflect Trio's maturity. (`#3216 <https://github.com/python-trio/trio/issues/3216>`__)
33+
34+
835
Trio 0.29.0 (2025-02-14)
936
------------------------
1037

docs/source/reference-core.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,14 @@ the numbers 0 through 9 with a 1-second delay before each one:
16071607
16081608
trio.run(use_it)
16091609
1610-
Trio supports async generators, with some caveats described in this section.
1610+
Trio supports async generators, but there's several caveats and it's very
1611+
hard to handle them properly. Therefore Trio bundles a helper,
1612+
`trio.as_safe_channel` that does it for you.
1613+
1614+
1615+
.. autofunction:: trio.as_safe_channel
1616+
1617+
The details behind the problems are described in the following sections.
16111618

16121619
Finalization
16131620
~~~~~~~~~~~~
@@ -1737,7 +1744,8 @@ so sometimes you'll get an unhelpful `TrioInternalError`. (And
17371744
sometimes it will seem to work, which is probably the worst outcome of
17381745
all, since then you might not notice the issue until you perform some
17391746
minor refactoring of the generator or the code that's iterating it, or
1740-
just get unlucky. There is a `proposed Python enhancement
1747+
just get unlucky. There is a draft :pep:`789` with accompanying
1748+
`discussion thread
17411749
<https://discuss.python.org/t/preventing-yield-inside-certain-context-managers/1091>`__
17421750
that would at least make it fail consistently.)
17431751

@@ -1753,12 +1761,6 @@ the generator is suspended, what should the background tasks do?
17531761
There's no good way to suspend them, but if they keep running and throw
17541762
an exception, where can that exception be reraised?
17551763

1756-
If you have an async generator that wants to ``yield`` from within a nursery
1757-
or cancel scope, your best bet is to refactor it to be a separate task
1758-
that communicates over memory channels. The ``trio_util`` package offers a
1759-
`decorator that does this for you transparently
1760-
<https://trio-util.readthedocs.io/en/latest/#trio_util.trio_async_generator>`__.
1761-
17621764
For more discussion, see
17631765
Trio issues `264 <https://github.com/python-trio/trio/issues/264>`__
17641766
(especially `this comment

newsfragments/2135.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/3133.bugfix.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

newsfragments/3183.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)