From 27876afeee963dfb8d161d8631b0fda0a36e1a2f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:05:12 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black-pre-commit-mirror: 25.12.0 → 26.1.0](https://github.com/psf/black-pre-commit-mirror/compare/25.12.0...26.1.0) - [github.com/astral-sh/ruff-pre-commit: v0.14.11 → v0.14.13](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.11...v0.14.13) - [github.com/woodruffw/zizmor-pre-commit: v1.20.0 → v1.22.0](https://github.com/woodruffw/zizmor-pre-commit/compare/v1.20.0...v1.22.0) - [github.com/astral-sh/uv-pre-commit: 0.9.24 → 0.9.26](https://github.com/astral-sh/uv-pre-commit/compare/0.9.24...0.9.26) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 973ed4279..760943250 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 From 14901d68474f780125122a07465fd7886a9e532e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:06:27 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- 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 | 6 +++--- 9 files changed, 22 insertions(+), 35 deletions(-) diff --git a/src/trio/_tests/check_type_completeness.py b/src/trio/_tests/check_type_completeness.py index ef5bdaafa..a0f23a66e 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 4786b06c9..b7614d0e5 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 c7d21ad25..12dc6a908 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 2b8a3a5ee..03918b0e1 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 4d1b08c06..f81004049 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 e42736d65..2aee56815 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 db64d36ea..b2acfdceb 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 e3d1659c0..1ec20e6bd 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 0bca01b22..7a857a2c0 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 @@ -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 @@ -198,7 +198,7 @@ typing-extensions==4.15.0 # virtualenv urllib3==2.6.2 # via requests -uv==0.9.24 +uv==0.9.26 # via -r test-requirements.in virtualenv==20.35.4 # via pre-commit From 1d802bfc20fe82ea67a9a981beb1c0ea206b2a75 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Tue, 20 Jan 2026 07:53:29 +0900 Subject: [PATCH 3/3] Try bumping pathspec --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 7a857a2c0..126a66d95 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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