From 5896f088b1ac6efed9683c97c358d49793376d80 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:57:29 +0000 Subject: [PATCH 1/4] Dependency updates --- .pre-commit-config.yaml | 8 +++--- docs-requirements.txt | 19 ++++++++----- src/trio/_tests/check_type_completeness.py | 1 + src/trio/_tests/test_deprecate.py | 20 +++---------- src/trio/_tests/test_fakenet.py | 10 +++---- src/trio/_tests/test_socket.py | 10 +++---- src/trio/_tests/test_unix_pipes.py | 2 +- src/trio/_tests/test_windows_pipes.py | 2 +- .../_tests/tools/test_sync_requirements.py | 5 +--- src/trio/_tools/gen_exports.py | 1 + test-requirements.txt | 28 +++++++++---------- 11 files changed, 49 insertions(+), 57 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 973ed4279a..7609432504 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,11 +20,11 @@ repos: - id: sort-simple-yaml files: .pre-commit-config.yaml - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.12.0 + rev: 26.1.0 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.11 + rev: v0.14.13 hooks: - id: ruff-check types: [file] @@ -46,7 +46,7 @@ repos: hooks: - id: sphinx-lint - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.20.0 + rev: v1.22.0 hooks: - id: zizmor - repo: local @@ -73,7 +73,7 @@ repos: additional_dependencies: ["pyyaml"] files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$ - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.9.24 + rev: 0.9.26 hooks: # Compile requirements - id: pip-compile diff --git a/docs-requirements.txt b/docs-requirements.txt index 03883f178f..d1e101b7d4 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -26,7 +26,7 @@ colorama==0.4.6 ; sys_platform == 'win32' # sphinx cryptography==46.0.3 # via pyopenssl -docutils==0.21.2 +docutils==0.22.4 # via # sphinx # sphinx-rtd-theme @@ -60,8 +60,6 @@ pyopenssl==25.3.0 requests==2.32.5 # via sphinx roman-numerals==4.1.0 - # via roman-numerals-py -roman-numerals-py==4.1.0 # via sphinx sniffio==1.3.1 # via -r docs-requirements.in @@ -69,9 +67,16 @@ snowballstemmer==3.0.1 # via sphinx sortedcontainers==2.4.0 # via -r docs-requirements.in -soupsieve==2.8.1 +soupsieve==2.8.2 # via beautifulsoup4 -sphinx==8.2.3 +sphinx==9.0.4 ; python_full_version < '3.12' + # via + # -r docs-requirements.in + # sphinx-codeautolink + # sphinx-rtd-theme + # sphinxcontrib-jquery + # sphinxcontrib-trio +sphinx==9.1.0 ; python_full_version >= '3.12' # via # -r docs-requirements.in # sphinx-codeautolink @@ -80,7 +85,7 @@ sphinx==8.2.3 # sphinxcontrib-trio sphinx-codeautolink==0.17.5 # via -r docs-requirements.in -sphinx-rtd-theme==3.0.2 +sphinx-rtd-theme==3.1.0 # via -r docs-requirements.in sphinxcontrib-applehelp==2.0.0 # via sphinx @@ -107,5 +112,5 @@ typing-extensions==4.15.0 # beautifulsoup4 # exceptiongroup # pyopenssl -urllib3==2.6.2 +urllib3==2.6.3 # via requests diff --git a/src/trio/_tests/check_type_completeness.py b/src/trio/_tests/check_type_completeness.py index ef5bdaafa4..a0f23a66e9 100755 --- a/src/trio/_tests/check_type_completeness.py +++ b/src/trio/_tests/check_type_completeness.py @@ -7,6 +7,7 @@ If this check is giving you false alarms, you can ignore them by adding logic to `has_docstring_at_runtime`, in the main loop in `check_type`, or by updating the json file. """ + from __future__ import annotations # this file is not run as part of the tests, instead it's run standalone from check.sh diff --git a/src/trio/_tests/test_deprecate.py b/src/trio/_tests/test_deprecate.py index 4786b06c96..b7614d0e52 100644 --- a/src/trio/_tests/test_deprecate.py +++ b/src/trio/_tests/test_deprecate.py @@ -200,45 +200,33 @@ def docstring_test4() -> None: # pragma: no cover def test_deprecated_docstring_munging() -> None: - assert ( - docstring_test1.__doc__ - == """Hello! + assert docstring_test1.__doc__ == """Hello! .. deprecated:: 2.1 Use hi instead. For details, see `issue #1 `__. """ - ) - assert ( - docstring_test2.__doc__ - == """Hello! + assert docstring_test2.__doc__ == """Hello! .. deprecated:: 2.1 Use hi instead. """ - ) - assert ( - docstring_test3.__doc__ - == """Hello! + assert docstring_test3.__doc__ == """Hello! .. deprecated:: 2.1 For details, see `issue #1 `__. """ - ) - assert ( - docstring_test4.__doc__ - == """Hello! + assert docstring_test4.__doc__ == """Hello! .. deprecated:: 2.1 """ - ) def test_module_with_deprecations(recwarn_always: pytest.WarningsRecorder) -> None: diff --git a/src/trio/_tests/test_fakenet.py b/src/trio/_tests/test_fakenet.py index c7d21ad25b..12dc6a9088 100644 --- a/src/trio/_tests/test_fakenet.py +++ b/src/trio/_tests/test_fakenet.py @@ -98,9 +98,9 @@ async def test_recv_methods() -> None: buf = bytearray(10) with pytest.raises(NotImplementedError, match=r"^partial recvfrom_into$"): - (nbytes, addr) = await s2.recvfrom_into(buf, nbytes=2) + nbytes, addr = await s2.recvfrom_into(buf, nbytes=2) - (nbytes, addr) = await s2.recvfrom_into(buf) + nbytes, addr = await s2.recvfrom_into(buf) assert nbytes == 3 assert buf == b"ghi" + b"\x00" * 7 assert addr == s1.getsockname() @@ -154,7 +154,7 @@ async def test_nonwindows_functionality() -> None: assert exc.value.errno == errno.ENOTCONN assert await s1.sendmsg([b"jkl"], (), 0, s2.getsockname()) == 3 - (data, ancdata, msg_flags, addr) = await s2.recvmsg(10) + data, ancdata, msg_flags, addr = await s2.recvmsg(10) assert data == b"jkl" assert ancdata == [] assert msg_flags == 0 @@ -167,7 +167,7 @@ async def test_nonwindows_functionality() -> None: buf1 = bytearray(2) buf2 = bytearray(3) ret = await s2.recvmsg_into([buf1, buf2]) - (nbytes, ancdata, msg_flags, addr) = ret + nbytes, ancdata, msg_flags, addr = ret assert nbytes == 4 assert buf1 == b"xy" assert buf2 == b"zw" + b"\x00" @@ -179,7 +179,7 @@ async def test_nonwindows_functionality() -> None: assert await s1.sendto(b"xyzwv", s2.getsockname()) == 5 buf1 = bytearray(2) ret = await s2.recvmsg_into([buf1]) - (nbytes, ancdata, msg_flags, addr) = ret + nbytes, ancdata, msg_flags, addr = ret assert nbytes == 2 assert buf1 == b"xy" assert ancdata == [] diff --git a/src/trio/_tests/test_socket.py b/src/trio/_tests/test_socket.py index 2b8a3a5ee1..03918b0e1f 100644 --- a/src/trio/_tests/test_socket.py +++ b/src/trio/_tests/test_socket.py @@ -975,7 +975,7 @@ async def test_send_recv_variants() -> None: # recvfrom + sendto, with and without names for target in targets: assert await a.sendto(b"xxx", target) == 3 - (data, addr) = await b.recvfrom(10) + data, addr = await b.recvfrom(10) assert data == b"xxx" assert addr == a.getsockname() @@ -991,21 +991,21 @@ async def test_send_recv_variants() -> None: await a.sendto(b"xxx", tsocket.MSG_MORE, b.getsockname()) await a.sendto(b"yyy", tsocket.MSG_MORE, b.getsockname()) await a.sendto(b"zzz", b.getsockname()) - (data, addr) = await b.recvfrom(10) + data, addr = await b.recvfrom(10) assert data == b"xxxyyyzzz" assert addr == a.getsockname() # recvfrom_into assert await a.sendto(b"xxx", b.getsockname()) == 3 buf = bytearray(10) - (nbytes, addr) = await b.recvfrom_into(buf) + nbytes, addr = await b.recvfrom_into(buf) assert nbytes == 3 assert buf == b"xxx" + b"\x00" * 7 assert addr == a.getsockname() if hasattr(b, "recvmsg"): assert await a.sendto(b"xxx", b.getsockname()) == 3 - (data, ancdata, msg_flags, addr) = await b.recvmsg(10) + data, ancdata, msg_flags, addr = await b.recvmsg(10) assert data == b"xxx" assert ancdata == [] assert msg_flags == 0 @@ -1016,7 +1016,7 @@ async def test_send_recv_variants() -> None: buf1 = bytearray(2) buf2 = bytearray(3) ret = await b.recvmsg_into([buf1, buf2]) - (nbytes, ancdata, msg_flags, addr) = ret + nbytes, ancdata, msg_flags, addr = ret assert nbytes == 4 assert buf1 == b"xy" assert buf2 == b"zw" + b"\x00" diff --git a/src/trio/_tests/test_unix_pipes.py b/src/trio/_tests/test_unix_pipes.py index 4d1b08c06e..f81004049f 100644 --- a/src/trio/_tests/test_unix_pipes.py +++ b/src/trio/_tests/test_unix_pipes.py @@ -26,7 +26,7 @@ async def make_pipe() -> tuple[FdStream, FdStream]: """Makes a new pair of pipes.""" - (r, w) = os.pipe() + r, w = os.pipe() return FdStream(w), FdStream(r) diff --git a/src/trio/_tests/test_windows_pipes.py b/src/trio/_tests/test_windows_pipes.py index e42736d65d..2aee568156 100644 --- a/src/trio/_tests/test_windows_pipes.py +++ b/src/trio/_tests/test_windows_pipes.py @@ -24,7 +24,7 @@ async def make_pipe() -> tuple[PipeSendStream, PipeReceiveStream]: """Makes a new pair of pipes.""" - (r, w) = pipe() + r, w = pipe() return PipeSendStream(w), PipeReceiveStream(r) diff --git a/src/trio/_tests/tools/test_sync_requirements.py b/src/trio/_tests/tools/test_sync_requirements.py index db64d36eaa..b2acfdceb5 100644 --- a/src/trio/_tests/tools/test_sync_requirements.py +++ b/src/trio/_tests/tools/test_sync_requirements.py @@ -52,16 +52,13 @@ def test_update_requirements( encoding="utf-8", ) assert update_requirements(requirements_file, {"black": "3.1.5", "ruff": "1.2.7"}) - assert ( - requirements_file.read_text(encoding="utf-8") - == """# comment + assert requirements_file.read_text(encoding="utf-8") == """# comment # also comment but spaces line start waffles are delicious no equals black==3.1.5 ; specific version thingy mypy==1.15.0 ruff==1.2.7 # required by soupy cat""" - ) def test_update_requirements_no_changes( diff --git a/src/trio/_tools/gen_exports.py b/src/trio/_tools/gen_exports.py index e3d1659c02..1ec20e6bd8 100755 --- a/src/trio/_tools/gen_exports.py +++ b/src/trio/_tools/gen_exports.py @@ -3,6 +3,7 @@ Code generation script for class methods to be exported as public API """ + from __future__ import annotations import argparse diff --git a/test-requirements.txt b/test-requirements.txt index 0bca01b222..f7591ceab6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -14,7 +14,7 @@ attrs==25.4.0 # outcome babel==2.17.0 # via sphinx -black==25.12.0 ; implementation_name == 'cpython' +black==26.1.0 ; implementation_name == 'cpython' # via -r test-requirements.in certifi==2026.1.4 # via requests @@ -44,7 +44,7 @@ cryptography==46.0.3 # pyopenssl # trustme # types-pyopenssl -dill==0.4.0 +dill==0.4.1 # via pylint distlib==0.4.0 # via virtualenv @@ -56,9 +56,9 @@ exceptiongroup==1.3.1 ; python_full_version < '3.11' # via # -r test-requirements.in # pytest -filelock==3.20.2 +filelock==3.20.3 # via virtualenv -identify==2.6.15 +identify==2.6.16 # via pre-commit idna==3.11 # via @@ -75,7 +75,7 @@ jedi==0.19.2 ; implementation_name == 'cpython' # via -r test-requirements.in jinja2==3.1.6 # via sphinx -librt==0.7.7 ; implementation_name == 'cpython' and platform_python_implementation != 'PyPy' +librt==0.7.8 ; implementation_name == 'cpython' and platform_python_implementation != 'PyPy' # via mypy markupsafe==3.0.3 # via jinja2 @@ -101,7 +101,7 @@ packaging==25.0 # sphinx parso==0.8.5 ; implementation_name == 'cpython' # via jedi -pathspec==0.12.1 ; implementation_name == 'cpython' +pathspec==1.0.3 ; implementation_name == 'cpython' # via # black # mypy @@ -124,11 +124,11 @@ pylint==4.0.4 # via -r test-requirements.in pyopenssl==25.3.0 # via -r test-requirements.in -pyright==1.1.407 +pyright==1.1.408 # via -r test-requirements.in pytest==9.0.2 # via -r test-requirements.in -pytokens==0.3.0 ; implementation_name == 'cpython' +pytokens==0.4.0 ; implementation_name == 'cpython' # via black pyyaml==6.0.3 # via pre-commit @@ -136,7 +136,7 @@ requests==2.32.5 # via sphinx roman-numerals==4.1.0 ; python_full_version >= '3.11' # via sphinx -ruff==0.14.11 +ruff==0.14.13 # via -r test-requirements.in sniffio==1.3.1 # via -r test-requirements.in @@ -162,14 +162,14 @@ sphinxcontrib-qthelp==2.0.0 # via sphinx sphinxcontrib-serializinghtml==2.0.0 # via sphinx -tomli==2.3.0 ; python_full_version < '3.11' +tomli==2.4.0 ; python_full_version < '3.11' # via # black # mypy # pylint # pytest # sphinx -tomlkit==0.13.3 +tomlkit==0.14.0 # via pylint trustme==1.2.1 # via -r test-requirements.in @@ -196,9 +196,9 @@ typing-extensions==4.15.0 # pyopenssl # pyright # virtualenv -urllib3==2.6.2 +urllib3==2.6.3 # via requests -uv==0.9.24 +uv==0.9.26 # via -r test-requirements.in -virtualenv==20.35.4 +virtualenv==20.36.1 # via pre-commit From 90cc27f3fde8d79e2fea82e04f05763c6781abd2 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Tue, 20 Jan 2026 08:02:00 +0900 Subject: [PATCH 2/4] Try upperbound for Sphinx --- docs-requirements.in | 4 ++-- docs-requirements.txt | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/docs-requirements.in b/docs-requirements.in index d942c084dc..adf9304fbc 100644 --- a/docs-requirements.in +++ b/docs-requirements.in @@ -1,6 +1,6 @@ # RTD is currently installing 1.5.3, which has a bug in :lineno-match: (??) -# sphinx 5.3 doesn't work with our _NoValue workaround -sphinx >= 6.0 +# sphinx 5.3 doesn't work with our _NoValue workaround, 9.0 breaks sphinxcontrib-trio +sphinx >= 6.0,<9.0 jinja2 # >= is necessary to prevent `uv` from selecting a `Sphinx` version this does not support sphinx_rtd_theme >= 3 diff --git a/docs-requirements.txt b/docs-requirements.txt index d1e101b7d4..ea161f8cfd 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -69,14 +69,7 @@ sortedcontainers==2.4.0 # via -r docs-requirements.in soupsieve==2.8.2 # via beautifulsoup4 -sphinx==9.0.4 ; python_full_version < '3.12' - # via - # -r docs-requirements.in - # sphinx-codeautolink - # sphinx-rtd-theme - # sphinxcontrib-jquery - # sphinxcontrib-trio -sphinx==9.1.0 ; python_full_version >= '3.12' +sphinx==8.2.3 # via # -r docs-requirements.in # sphinx-codeautolink From a5d7dd0f0396724ef856ec1bab8478892da7ae12 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Tue, 20 Jan 2026 08:08:38 +0900 Subject: [PATCH 3/4] Manually lock docutils too --- docs-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-requirements.txt b/docs-requirements.txt index ea161f8cfd..85af1dd295 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -26,7 +26,7 @@ colorama==0.4.6 ; sys_platform == 'win32' # sphinx cryptography==46.0.3 # via pyopenssl -docutils==0.22.4 +docutils==0.21.2 # via # sphinx # sphinx-rtd-theme From 81d0653b57e4ebbfee9d4bda3621ae335c06c652 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Tue, 20 Jan 2026 11:31:08 +0900 Subject: [PATCH 4/4] Final manual lockfile fixes --- docs-requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs-requirements.txt b/docs-requirements.txt index 85af1dd295..7ed83e4c48 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -60,6 +60,8 @@ pyopenssl==25.3.0 requests==2.32.5 # via sphinx roman-numerals==4.1.0 + # via roman-numerals-py +roman-numerals-py==4.1.0 # via sphinx sniffio==1.3.1 # via -r docs-requirements.in