diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f1f81558..34943123e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] @@ -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 diff --git a/docs-requirements.txt b/docs-requirements.txt index b9e55cac8..ccd0b372e 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/trio/_core/_tests/test_ki.py b/src/trio/_core/_tests/test_ki.py index 8d09233d6..1ce4af9aa 100644 --- a/src/trio/_core/_tests/test_ki.py +++ b/src/trio/_core/_tests/test_ki.py @@ -32,6 +32,9 @@ Generator, Iterator, ) + from types import AsyncGeneratorType + + from typing_extensions import Never from ..._core import Abort, RaiseCancelT @@ -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() @@ -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: diff --git a/src/trio/_tests/test_exports.py b/src/trio/_tests/test_exports.py index f70da41b0..1c2b46ca4 100644 --- a/src/trio/_tests/test_exports.py +++ b/src/trio/_tests/test_exports.py @@ -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") diff --git a/src/trio/_threads.py b/src/trio/_threads.py index 4b1e54f54..46de93563 100644 --- a/src/trio/_threads.py +++ b/src/trio/_threads.py @@ -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) diff --git a/test-requirements.txt b/test-requirements.txt index db1354ea1..8b2013e96 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -18,7 +18,7 @@ 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 @@ -26,7 +26,7 @@ cffi==2.0.0 ; os_name == 'nt' or platform_python_implementation != 'PyPy' # 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -176,7 +175,7 @@ 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 @@ -184,15 +183,15 @@ 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 @@ -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