Skip to content

Commit 72ac535

Browse files
committed
Merge remote-tracking branch 'origin/main' into background_with_channel
2 parents 26ed1c6 + f500503 commit 72ac535

30 files changed

+442
-208
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: 4 additions & 4 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.9.9
27+
rev: v0.11.4
2828
hooks:
2929
- id: ruff
3030
types: [file]
@@ -38,15 +38,15 @@ repos:
3838
# tomli needed on 3.10. tomllib is available in stdlib on 3.11+
3939
- tomli
4040
- repo: https://github.com/crate-ci/typos
41-
rev: typos-dict-v0.12.6
41+
rev: v1.31.1
4242
hooks:
4343
- id: typos
4444
- repo: https://github.com/sphinx-contrib/sphinx-lint
4545
rev: v1.0.0
4646
hooks:
4747
- id: sphinx-lint
4848
- repo: https://github.com/woodruffw/zizmor-pre-commit
49-
rev: v1.4.1
49+
rev: v1.5.2
5050
hooks:
5151
- id: zizmor
5252
- repo: local
@@ -59,7 +59,7 @@ repos:
5959
additional_dependencies: ["astor", "attrs", "black", "ruff"]
6060
files: ^src\/trio\/_core\/(_run|(_i(o_(common|epoll|kqueue|windows)|nstrumentation)))\.py$
6161
- repo: https://github.com/astral-sh/uv-pre-commit
62-
rev: 0.6.3
62+
rev: 0.6.13
6363
hooks:
6464
# Compile requirements
6565
- id: pip-compile

docs-requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# uv pip compile --universal --python-version=3.11 docs-requirements.in -o docs-requirements.txt
33
alabaster==1.0.0
44
# via sphinx
5-
attrs==25.1.0
5+
attrs==25.3.0
66
# via
77
# -r docs-requirements.in
88
# outcome
@@ -24,7 +24,7 @@ colorama==0.4.6 ; sys_platform == 'win32'
2424
# via
2525
# click
2626
# sphinx
27-
cryptography==44.0.1
27+
cryptography==44.0.2
2828
# via pyopenssl
2929
docutils==0.21.2
3030
# via
@@ -40,7 +40,7 @@ imagesize==1.4.1
4040
# via sphinx
4141
immutables==0.21
4242
# via -r docs-requirements.in
43-
jinja2==3.1.5
43+
jinja2==3.1.6
4444
# via
4545
# -r docs-requirements.in
4646
# sphinx
@@ -69,15 +69,15 @@ sortedcontainers==2.4.0
6969
# via -r docs-requirements.in
7070
soupsieve==2.6
7171
# via beautifulsoup4
72-
sphinx==8.2.1
72+
sphinx==8.2.3
7373
# via
7474
# -r docs-requirements.in
7575
# sphinx-codeautolink
7676
# sphinx-hoverxref
7777
# sphinx-rtd-theme
7878
# sphinxcontrib-jquery
7979
# sphinxcontrib-trio
80-
sphinx-codeautolink==0.17.1
80+
sphinx-codeautolink==0.17.4
8181
# via -r docs-requirements.in
8282
sphinx-hoverxref==1.4.2
8383
# via -r docs-requirements.in
@@ -104,7 +104,7 @@ sphinxcontrib-trio==1.1.2
104104
# via -r docs-requirements.in
105105
towncrier==24.8.0
106106
# via -r docs-requirements.in
107-
typing-extensions==4.12.2
107+
typing-extensions==4.13.0
108108
# via
109109
# beautifulsoup4
110110
# pyopenssl

docs/source/_static/hackrtd.css renamed to docs/source/_static/styles.css

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/* Temporary hack to work around bug in rtd theme 2.0 through 2.4
2-
See https://github.com/rtfd/sphinx_rtd_theme/pull/382
3-
*/
4-
pre {
5-
line-height: normal !important;
6-
}
7-
81
/* Make .. deprecation:: blocks visible
92
* (by default they're entirely unstyled)
103
*/
@@ -23,6 +16,10 @@ pre {
2316
* thingummy also has an <hr> in it, and putting the ornament on that looks
2417
* *really weird*. (In particular, the background color is wrong.)
2518
*/
19+
.rst-content hr {
20+
overflow: visible;
21+
}
22+
2623
.rst-content hr:after {
2724
/* This .svg gets displayed on top of the middle of the hrule. It has a box
2825
* behind the logo that's colored to match the RTD theme body background
@@ -41,39 +38,21 @@ pre {
4138

4239
/* Hacks to make the upper-left logo area look nicer */
4340

44-
.wy-side-nav-search {
45-
/* Lighter background color to match logo */
46-
background-color: #d2e7fa !important;
47-
}
48-
4941
.wy-side-nav-search > a {
5042
color: #306998 !important;
5143
}
5244

53-
.wy-side-nav-search > a.logo {
54-
display: block !important;
55-
padding-bottom: 0.809em !important;
45+
/* vertically center version text */
46+
.wy-side-nav-search > a {
47+
display: flex;
48+
align-items: center;
49+
margin: auto;
50+
width: max-content;
5651
}
5752

5853
.wy-side-nav-search > a img.logo {
59-
display: inline !important;
60-
padding: 0 !important;
61-
}
62-
63-
.trio-version {
64-
display: inline;
65-
/* I *cannot* figure out how to get the version text vertically centered
66-
on the logo. Oh well...
67-
height: 32px;
68-
line-height: 32px;
69-
*/
70-
}
71-
72-
.wy-side-nav-search > a {
73-
/* Mostly this is just to simplify things, so we don't have margin/padding
74-
* on both the <a> and the <img> inside it */
75-
margin: 0 !important;
76-
padding: 0 !important;
54+
margin-left: 0;
55+
margin-right: 5px;
7756
}
7857

7958
/* Get rid of the weird super dark "Contents" label that wastes vertical space

docs/source/_templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<a class="logo" href="{{ pathto(root_doc) }}">
1313
<img class="logo" src="{{ logo_url }}" />
1414
{%- set nav_version = version %}
15-
{% if READTHEDOCS and current_version %}
15+
{% if current_version %}
1616
{%- set nav_version = current_version %}
1717
{% endif %}
1818
{# don't show the version on RTD if it's the default #}

docs/source/conf.py

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from typing import TYPE_CHECKING, cast
2727

2828
from sphinx.util.inventory import _InventoryItem
29+
from sphinx.util.logging import getLogger
2930

3031
if TYPE_CHECKING:
3132
from sphinx.application import Sphinx
@@ -167,25 +168,55 @@ def autodoc_process_signature(
167168
return signature, return_annotation
168169

169170

170-
# XX hack the RTD theme until
171-
# https://github.com/rtfd/sphinx_rtd_theme/pull/382
172-
# is shipped (should be in the release after 0.2.4)
173-
# ...note that this has since grown to contain a bunch of other CSS hacks too
174-
# though.
171+
# currently undocumented things
172+
logger = getLogger("trio")
173+
UNDOCUMENTED = {
174+
"trio.MemorySendChannel",
175+
"trio.MemoryReceiveChannel",
176+
"trio.MemoryChannelStatistics",
177+
"trio.SocketStream.aclose",
178+
"trio.SocketStream.receive_some",
179+
"trio.SocketStream.send_all",
180+
"trio.SocketStream.send_eof",
181+
"trio.SocketStream.wait_send_all_might_not_block",
182+
"trio._subprocess.HasFileno.fileno",
183+
"trio.lowlevel.ParkingLot.broken_by",
184+
}
185+
186+
187+
def autodoc_process_docstring(
188+
app: Sphinx,
189+
what: str,
190+
name: str,
191+
obj: object,
192+
options: object,
193+
lines: list[str],
194+
) -> None:
195+
if not lines:
196+
# TODO: document these and remove them from here
197+
if name in UNDOCUMENTED:
198+
return
199+
200+
logger.warning(f"{name} has no docstring")
201+
else:
202+
if name in UNDOCUMENTED:
203+
logger.warning(
204+
f"outdated list of undocumented things in docs/source/conf.py: {name!r} has a docstring"
205+
)
206+
207+
175208
def setup(app: Sphinx) -> None:
176-
app.add_css_file("hackrtd.css")
209+
# Add our custom styling to make our documentation better!
210+
app.add_css_file("styles.css")
177211
app.connect("autodoc-process-signature", autodoc_process_signature)
212+
app.connect("autodoc-process-docstring", autodoc_process_docstring)
213+
178214
# After Intersphinx runs, add additional mappings.
179215
app.connect("builder-inited", add_intersphinx, priority=1000)
180216
app.connect("source-read", on_read_source)
181217

182218

183-
# Our docs use the READTHEDOCS variable, so copied from:
184-
# https://about.readthedocs.com/blog/2024/07/addons-by-default/
185-
if os.environ.get("READTHEDOCS", "") == "True":
186-
if "html_context" not in globals():
187-
html_context = {}
188-
html_context["READTHEDOCS"] = True
219+
html_context = {"current_version": os.environ.get("READTHEDOCS_VERSION_NAME")}
189220

190221
# -- General configuration ------------------------------------------------
191222

@@ -375,6 +406,7 @@ def add_mapping(
375406
"navigation_depth": 4,
376407
"logo_only": True,
377408
"prev_next_buttons_location": "both",
409+
"style_nav_header_background": "#d2e7fa",
378410
}
379411

380412
# Add any paths that contain custom static files (such as style sheets) here,

newsfragments/2135.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Allow `trio` to be a `types.ModuleType` and still have deprecated attributes.

newsfragments/3133.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed socket module for some older systems which lack ``socket.AI_NUMERICSERV``.
2+
Now trio works on legacy (pre-Lion) macOS.

newsfragments/3183.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update type hints for `trio.run_process` and `trio.lowlevel.open_process`.

newsfragments/3205.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Don't mutate the global runner when MockClock is created.

0 commit comments

Comments
 (0)