Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.0
rev: v0.16.1
hooks:
- id: ruff-check
types: [file]
Expand Down Expand Up @@ -69,7 +69,7 @@ repos:
additional_dependencies: ["pyyaml"]
files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.32
rev: 0.12.1
hooks:
# Compile requirements
- id: pip-compile
Expand Down
10 changes: 5 additions & 5 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ babel==2.18.0
# via sphinx
beautifulsoup4==4.15.0
# via sphinx-codeautolink
certifi==2026.6.17
certifi==2026.7.22
# via requests
cffi==2.0.0 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
# via
# -r docs-requirements.in
# cryptography
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
click==8.4.2
# via towncrier
Expand Down Expand Up @@ -67,7 +67,7 @@ snowballstemmer==3.1.1
# via sphinx
sortedcontainers==2.4.0
# via -r docs-requirements.in
soupsieve==2.8.4
soupsieve==2.9.1
# via beautifulsoup4
sphinx==9.0.4 ; python_full_version < '3.12'
# via
Expand All @@ -83,7 +83,7 @@ sphinx==9.1.0 ; python_full_version >= '3.12'
# sphinx-rtd-theme
# sphinxcontrib-jquery
# sphinxcontrib-trio
sphinx-codeautolink==0.18.1
sphinx-codeautolink==0.19.0
# via -r docs-requirements.in
sphinx-rtd-theme==3.1.0
# via -r docs-requirements.in
Expand All @@ -107,7 +107,7 @@ sphinxcontrib-trio==1.2.0
# via -r docs-requirements.in
towncrier==25.8.0
# via -r docs-requirements.in
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# beautifulsoup4
# exceptiongroup
Expand Down
9 changes: 6 additions & 3 deletions src/trio/_core/_tests/test_ki.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
Generator,
Iterator,
)
from types import AsyncGeneratorType

from typing_extensions import Never

from ..._core import Abort, RaiseCancelT

Expand Down Expand Up @@ -665,11 +668,11 @@ def _unprotected_gen_fn() -> Generator[None, None, None]:
yield


async def _consume_async_generator(agen: AsyncGenerator[None, None]) -> None:
async def _consume_async_generator(agen: AsyncGeneratorType[object, Never]) -> None:
try:
with pytest.raises(StopAsyncIteration):
while True:
await agen.asend(None)
await agen.asend(None) # type: ignore[arg-type]
finally:
await agen.aclose()

Expand All @@ -684,7 +687,7 @@ def _consume_function_for_coverage(
assert inspect.isgenerator(result) or inspect.iscoroutine(result)
with pytest.raises(StopIteration):
while True:
result.send(None)
result.send(None) # type: ignore[arg-type]


def test_enable_disable_ki_protection_passes_on_inspect_flags() -> None:
Expand Down
6 changes: 5 additions & 1 deletion src/trio/_tests/test_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,11 @@ def lookup_symbol(symbol: str) -> dict[str, Any]: # type: ignore[misc, explicit
extra = {e for e in extra if not e.endswith("AttrsAttributes__")}
assert len(extra) == before - 1

if issubclass(class_, trio.Path) and sys.version_info >= (3, 15):
if (
tool == "jedi"
and issubclass(class_, trio.Path)
and sys.version_info >= (3, 15)
):
# needs a typeshed update for https://github.com/python/typeshed/pull/15737
extra.remove("is_reserved")

Expand Down
2 changes: 1 addition & 1 deletion src/trio/_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ async def to_thread_run_sync(
task_register: list[trio.lowlevel.Task | None] = [trio.lowlevel.current_task()]
# Holds a reference to the raise_cancel function provided if a cancellation
# is attempted against this task - or None if no such delivery has happened.
cancel_register: list[RaiseCancelT | None] = [None] # type: ignore[assignment]
cancel_register: list[RaiseCancelT | None] = [None]
name = f"trio.to_thread.run_sync-{next(_thread_counter)}"
placeholder = ThreadPlaceholder(name)

Expand Down
33 changes: 16 additions & 17 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ babel==2.18.0
# via sphinx
black==26.5.1 ; implementation_name == 'cpython'
# via -r test-requirements.in
certifi==2026.6.17
certifi==2026.7.22
# via requests
cffi==2.0.0 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
# via
# -r test-requirements.in
# cryptography
cfgv==3.5.0
# via pre-commit
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
click==8.4.2 ; implementation_name == 'cpython'
# via black
Expand Down Expand Up @@ -58,7 +58,7 @@ exceptiongroup==1.3.1 ; python_full_version < '3.11'
# via
# -r test-requirements.in
# pytest
filelock==3.29.4
filelock==3.32.2
# via
# python-discovery
# virtualenv
Expand All @@ -79,13 +79,13 @@ jedi==0.20.0 ; implementation_name == 'cpython'
# via -r test-requirements.in
jinja2==3.1.6
# via sphinx
librt==0.12.0 ; implementation_name == 'cpython' and platform_python_implementation != 'PyPy'
librt==0.13.0 ; implementation_name == 'cpython' and platform_python_implementation != 'PyPy'
# via mypy
markupsafe==3.0.3
# via jinja2
mccabe==0.7.0
# via pylint
mypy==2.1.0 ; implementation_name == 'cpython'
mypy==2.3.0 ; implementation_name == 'cpython'
# via -r test-requirements.in
mypy-extensions==1.1.0
# via
Expand All @@ -109,15 +109,14 @@ pathspec==1.1.1 ; implementation_name == 'cpython'
# via
# black
# mypy
platformdirs==4.10.0
platformdirs==4.11.0
# via
# black
# pylint
# python-discovery
# virtualenv
pluggy==1.6.0
# via pytest
pre-commit==4.6.0
pre-commit==4.6.1
# via -r test-requirements.in
pycparser==3.0 ; (implementation_name != 'PyPy' and os_name == 'nt') or (implementation_name != 'PyPy' and platform_python_implementation != 'PyPy')
# via cffi
Expand All @@ -133,7 +132,7 @@ pyright==1.1.411
# via -r test-requirements.in
pytest==9.1.1
# via -r test-requirements.in
python-discovery==1.4.2
python-discovery==1.5.1
# via virtualenv
pytokens==0.4.1 ; implementation_name == 'cpython'
# via black
Expand All @@ -143,7 +142,7 @@ requests==2.34.2
# via sphinx
roman-numerals==4.1.0 ; python_full_version >= '3.11'
# via sphinx
ruff==0.16.0
ruff==0.16.1
# via -r test-requirements.in
sniffio==1.3.1
# via -r test-requirements.in
Expand Down Expand Up @@ -176,23 +175,23 @@ tomli==2.4.1 ; python_full_version < '3.11'
# pylint
# pytest
# sphinx
tomlkit==0.15.0
tomlkit==0.15.1
# via pylint
trustme==1.2.1
# via -r test-requirements.in
types-cffi==2.0.0.20260518
# via
# -r test-requirements.in
# types-pyopenssl
types-docutils==0.22.3.20260518
types-docutils==0.22.3.20260724
# via -r test-requirements.in
types-pyopenssl==24.1.0.20240722
# via -r test-requirements.in
types-pyyaml==6.0.12.20260518
types-pyyaml==6.0.12.20260724
# via -r test-requirements.in
types-setuptools==82.0.0.20260518
types-setuptools==83.0.0.20260724
# via types-cffi
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# -r test-requirements.in
# astroid
Expand All @@ -205,7 +204,7 @@ typing-extensions==4.15.0
# virtualenv
urllib3==2.7.0
# via requests
uv==0.11.32
uv==0.12.1
# via -r test-requirements.in
virtualenv==21.5.1
virtualenv==21.7.1
# via pre-commit