Skip to content

Commit f71cbda

Browse files
authored
Merge branch 'main' into idna-consistently
2 parents b5ed232 + 9f2df4e commit f71cbda

22 files changed

Lines changed: 198 additions & 131 deletions

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
strategy:
169169
fail-fast: false
170170
matrix:
171-
python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15-dev']
171+
python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15', '3.15t']
172172
arch: ['x86', 'x64']
173173
lsp: ['']
174174
lsp_extract_file: ['']
@@ -243,7 +243,7 @@ jobs:
243243
strategy:
244244
fail-fast: false
245245
matrix:
246-
python: ['pypy-3.11', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15-dev']
246+
python: ['pypy-3.11', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15', '3.15t']
247247
check_formatting: ['0']
248248
no_test_requirements: ['0']
249249
extra_name: ['']
@@ -321,7 +321,7 @@ jobs:
321321
strategy:
322322
fail-fast: false
323323
matrix:
324-
python: ['pypy-3.11', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15-dev']
324+
python: ['pypy-3.11', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15', '3.15t']
325325
continue-on-error: >-
326326
${{
327327
(
@@ -419,7 +419,7 @@ jobs:
419419
# TODO: technically we should pin cython versions
420420
- python: '3.10'
421421
cython: '>=3'
422-
- python: '3.14'
422+
- python: '3.15'
423423
cython: '>=3'
424424
steps:
425425
- name: Retrieve the project source from an sdist inside the GHA artifact

‎.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.17.0
27+
rev: v0.17.2
2828
hooks:
2929
- id: ruff-check
3030
types: [file]
@@ -69,7 +69,7 @@ repos:
6969
additional_dependencies: ["pyyaml"]
7070
files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$
7171
- repo: https://github.com/astral-sh/uv-pre-commit
72-
rev: 0.13.0
72+
rev: 0.13.5
7373
hooks:
7474
# Compile requirements
7575
- id: pip-compile

‎docs-requirements.txt‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ babel==2.18.0
1010
# via sphinx
1111
beautifulsoup4==4.15.0
1212
# via sphinx-codeautolink
13-
certifi==2026.7.22
13+
certifi==2026.10.23
1414
# via requests
1515
cffi==2.1.1 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
1616
# via
@@ -43,13 +43,13 @@ jinja2==3.1.6
4343
# -r docs-requirements.in
4444
# sphinx
4545
# towncrier
46-
markupsafe==3.0.3
46+
markupsafe==3.0.4
4747
# via jinja2
4848
outcome==1.3.0.post0
4949
# via -r docs-requirements.in
5050
packaging==26.3
5151
# via sphinx
52-
pycparser==3.0 ; (implementation_name != 'PyPy' and os_name == 'nt') or (implementation_name != 'PyPy' and platform_python_implementation != 'PyPy')
52+
pycparser==3.12 ; (implementation_name != 'PyPy' and os_name == 'nt') or (implementation_name != 'PyPy' and platform_python_implementation != 'PyPy')
5353
# via cffi
5454
pygments==2.21.0
5555
# via sphinx
@@ -65,7 +65,9 @@ snowballstemmer==3.1.1
6565
# via sphinx
6666
sortedcontainers==2.4.0
6767
# via -r docs-requirements.in
68-
soupsieve==2.10
68+
soupsieve==2.10 ; python_full_version < '3.11.5'
69+
# via beautifulsoup4
70+
soupsieve==3.0.4 ; python_full_version >= '3.11.5'
6971
# via beautifulsoup4
7072
sphinx==9.0.4 ; python_full_version < '3.12'
7173
# via
@@ -74,7 +76,14 @@ sphinx==9.0.4 ; python_full_version < '3.12'
7476
# sphinx-rtd-theme
7577
# sphinxcontrib-jquery
7678
# sphinxcontrib-trio
77-
sphinx==9.1.0 ; python_full_version >= '3.12'
79+
sphinx==9.1.1 ; python_full_version == '3.12.*'
80+
# via
81+
# -r docs-requirements.in
82+
# sphinx-codeautolink
83+
# sphinx-rtd-theme
84+
# sphinxcontrib-jquery
85+
# sphinxcontrib-trio
86+
sphinx==9.2.0 ; python_full_version >= '3.13'
7887
# via
7988
# -r docs-requirements.in
8089
# sphinx-codeautolink
@@ -95,7 +104,7 @@ sphinxcontrib-jquery==4.1
95104
# via
96105
# -r docs-requirements.in
97106
# sphinx-rtd-theme
98-
sphinxcontrib-jsmath==1.0.1
107+
sphinxcontrib-jsmath==2.0.0
99108
# via sphinx
100109
sphinxcontrib-qthelp==2.0.0
101110
# via sphinx

‎newsfragments/3542.misc.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The typing for :ref:`async-file-objects` is now consistent about what it exposes based on what is exposed by the underlying object.

‎newsfragments/3563.feature.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Mark that we support 3.15.

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ classifiers = [
3131
"Programming Language :: Python :: 3.12",
3232
"Programming Language :: Python :: 3.13",
3333
"Programming Language :: Python :: 3.14",
34+
"Programming Language :: Python :: 3.15",
3435
"Topic :: System :: Networking",
3536
"Typing :: Typed",
3637
]

‎src/trio/_abc.py‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import socket
44
from abc import ABC, abstractmethod
5-
from typing import TYPE_CHECKING, Generic, TypeVar
5+
from typing import TYPE_CHECKING, Generic, Literal, TypeVar
66

77
import trio
88

@@ -173,12 +173,20 @@ async def getaddrinfo(
173173
proto: int = 0,
174174
flags: int = 0,
175175
) -> list[
176+
# copied from _GetAddrInfoEntry
176177
tuple[
177-
socket.AddressFamily,
178+
Literal[socket.AddressFamily.AF_INET],
178179
socket.SocketKind,
179180
int,
180181
str,
181-
tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes],
182+
tuple[str, int],
183+
]
184+
| tuple[
185+
Literal[socket.AddressFamily.AF_INET6],
186+
socket.SocketKind,
187+
int,
188+
str,
189+
tuple[str, int, int, int] | tuple[int, bytes],
182190
]
183191
]:
184192
"""A custom implementation of :func:`~trio.socket.getaddrinfo`.

‎src/trio/_dtls.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ def __init__(
841841
self.endpoint = endpoint
842842
self.peer_address = peer_address
843843
self._packets_dropped_in_trio = 0
844-
self._client_hello = None
844+
self._client_hello: tuple[bytes, bytes] | None = None
845845
self._did_handshake = False
846846
self._ssl = SSL.Connection(ctx)
847847
self._handshake_mtu = 0

‎src/trio/_file_io.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class _CanReadLines(Protocol[AnyStr]):
188188
def readlines(self, hint: int = ..., /) -> list[AnyStr]: ...
189189

190190
class _CanSeek(Protocol):
191-
def seek(self, target: int, whence: int = 0, /) -> int: ...
191+
def seek(self, target: int, whence: int = ..., /) -> int: ...
192192

193193
class _CanTell(Protocol):
194194
def tell(self) -> int: ...
@@ -204,7 +204,7 @@ class _CanWriteLines(Protocol[T_contra]):
204204
def writelines(self, lines: Iterable[T_contra], /) -> None: ...
205205

206206
class _CanPeek(Protocol[AnyStr_co]):
207-
def peek(self, size: int = 0, /) -> AnyStr_co: ...
207+
def peek(self, size: int = ..., /) -> AnyStr_co: ...
208208

209209
class _CanDetach(Protocol[T_co]):
210210
# The T typevar will be the unbuffered/binary file this file wraps.
@@ -313,7 +313,7 @@ def buffer(self: AsyncIOWrapper[_HasBuffer]) -> BinaryIO: ...
313313
@property
314314
def raw(self: AsyncIOWrapper[_HasRaw]) -> io.RawIOBase: ...
315315
@property
316-
def line_buffering(self: AsyncIOWrapper[_HasLineBuffering]) -> int: ...
316+
def line_buffering(self: AsyncIOWrapper[_HasLineBuffering]) -> bool: ...
317317
@property
318318
def closefd(self: AsyncIOWrapper[_HasCloseFD]) -> bool: ...
319319
@property
@@ -334,7 +334,7 @@ async def read1(self: AsyncIOWrapper[_CanRead1], size: int | None = -1, /) -> by
334334
async def readall(self: AsyncIOWrapper[_CanReadAll[AnyStr]]) -> AnyStr: ...
335335
async def readinto(self: AsyncIOWrapper[_CanReadInto], buf: Buffer, /) -> int | None: ...
336336
async def readline(self: AsyncIOWrapper[_CanReadLine[AnyStr]], size: int = -1, /) -> AnyStr: ...
337-
async def readlines(self: AsyncIOWrapper[_CanReadLines[AnyStr]]) -> list[AnyStr]: ...
337+
async def readlines(self: AsyncIOWrapper[_CanReadLines[AnyStr]], hint: int = -1, /) -> list[AnyStr]: ...
338338
async def seek(self: AsyncIOWrapper[_CanSeek], target: int, whence: int = 0, /) -> int: ...
339339
async def tell(self: AsyncIOWrapper[_CanTell]) -> int: ...
340340
async def truncate(self: AsyncIOWrapper[_CanTruncate], size: int | None = None, /) -> int: ...

‎src/trio/_highlevel_open_tcp_stream.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import sys
44
from contextlib import contextmanager, suppress
5-
from typing import TYPE_CHECKING, Any
5+
from typing import TYPE_CHECKING
66

77
import trio
88
from trio.socket import SOCK_STREAM, SocketType, getaddrinfo, socket
@@ -11,7 +11,7 @@
1111
from collections.abc import Generator, MutableSequence
1212
from socket import AddressFamily, SocketKind
1313

14-
from trio._socket import AddressFormat
14+
from trio._socket import AddressFormat, _GetAddrInfoEntry
1515

1616
if sys.version_info < (3, 11):
1717
from exceptiongroup import BaseExceptionGroup, ExceptionGroup
@@ -134,8 +134,8 @@ def close_all() -> Generator[set[SocketType], None, None]:
134134
raise BaseExceptionGroup("", errs)
135135

136136

137-
def reorder_for_rfc_6555_section_5_4( # type: ignore[explicit-any]
138-
targets: MutableSequence[tuple[AddressFamily, SocketKind, int, str, Any]],
137+
def reorder_for_rfc_6555_section_5_4(
138+
targets: MutableSequence[_GetAddrInfoEntry],
139139
) -> None:
140140
# RFC 6555 section 5.4 says that if getaddrinfo returns multiple address
141141
# families (e.g. IPv4 and IPv6), then you should make sure that your first

0 commit comments

Comments
 (0)