Skip to content

Commit f9411f4

Browse files
github-actions[bot]pre-commit-ci[bot]A5rocks
authored
Bump dependencies from commit 8d37eb (#3146)
* Dependency updates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Undo cryptography bump Need to wait for a trustme release, I think * Revert pyOpenSSL, undo cryptography revert * Revert cryptography again * Fix things for lints --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: EXPLOSION <git@helvetica.moe>
1 parent 8d37eb6 commit f9411f4

15 files changed

+44
-42
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
hooks:
2323
- id: black
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.8.0
25+
rev: v0.8.1
2626
hooks:
2727
- id: ruff
2828
types: [file]

docs-requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ colorama==0.4.6 ; sys_platform == 'win32' or platform_system == 'Windows'
2424
# via
2525
# click
2626
# sphinx
27-
cryptography==43.0.3
27+
cryptography==44.0.0
2828
# via pyopenssl
2929
docutils==0.21.2
3030
# via
@@ -49,13 +49,13 @@ markupsafe==3.0.2
4949
# via jinja2
5050
outcome==1.3.0.post0
5151
# via -r docs-requirements.in
52-
packaging==24.1
52+
packaging==24.2
5353
# via sphinx
5454
pycparser==2.22 ; platform_python_implementation != 'PyPy' or os_name == 'nt'
5555
# via cffi
5656
pygments==2.18.0
5757
# via sphinx
58-
pyopenssl==24.2.1
58+
pyopenssl==24.3.0
5959
# via -r docs-requirements.in
6060
requests==2.32.3
6161
# via sphinx
@@ -77,9 +77,9 @@ sphinx==8.1.3
7777
# sphinxcontrib-trio
7878
sphinx-codeautolink==0.15.2
7979
# via -r docs-requirements.in
80-
sphinx-hoverxref==1.4.1
80+
sphinx-hoverxref==1.4.2
8181
# via -r docs-requirements.in
82-
sphinx-rtd-theme==3.0.1
82+
sphinx-rtd-theme==3.0.2
8383
# via -r docs-requirements.in
8484
sphinxcontrib-applehelp==2.0.0
8585
# via sphinx

src/trio/_core/_concat_tb.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from __future__ import annotations
22

3-
from types import TracebackType
43
from typing import TYPE_CHECKING, ClassVar, cast
54

5+
if TYPE_CHECKING:
6+
from types import TracebackType
7+
68
################################################################
79
# concat_tb
810
################################################################
@@ -107,7 +109,7 @@ def controller( # type: ignore[no-any-unimported]
107109
return operation.delegate() # type: ignore[no-any-return]
108110

109111
return cast(
110-
TracebackType,
112+
"TracebackType",
111113
tputil.make_proxy(controller, type(base_tb), base_tb),
112114
) # Returns proxy to traceback
113115

src/trio/_core/_io_windows.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ def _refresh_afd(self, base_handle: Handle) -> None:
700700

701701
lpOverlapped = ffi.new("LPOVERLAPPED")
702702

703-
poll_info = cast(_AFDPollInfo, ffi.new("AFD_POLL_INFO *"))
703+
poll_info = cast("_AFDPollInfo", ffi.new("AFD_POLL_INFO *"))
704704
poll_info.Timeout = 2**63 - 1 # INT64_MAX
705705
poll_info.NumberOfHandles = 1
706706
poll_info.Exclusive = 0
@@ -713,9 +713,9 @@ def _refresh_afd(self, base_handle: Handle) -> None:
713713
kernel32.DeviceIoControl(
714714
afd_group.handle,
715715
IoControlCodes.IOCTL_AFD_POLL,
716-
cast(CType, poll_info),
716+
cast("CType", poll_info),
717717
ffi.sizeof("AFD_POLL_INFO"),
718-
cast(CType, poll_info),
718+
cast("CType", poll_info),
719719
ffi.sizeof("AFD_POLL_INFO"),
720720
ffi.NULL,
721721
lpOverlapped,
@@ -937,13 +937,13 @@ async def _perform_overlapped(
937937
# operation will not be cancellable, depending on how Windows is
938938
# feeling today. So we need to check for cancellation manually.
939939
await _core.checkpoint_if_cancelled()
940-
lpOverlapped = cast(_Overlapped, ffi.new("LPOVERLAPPED"))
940+
lpOverlapped = cast("_Overlapped", ffi.new("LPOVERLAPPED"))
941941
try:
942942
submit_fn(lpOverlapped)
943943
except OSError as exc:
944944
if exc.winerror != ErrorCodes.ERROR_IO_PENDING:
945945
raise
946-
await self.wait_overlapped(handle, cast(CData, lpOverlapped))
946+
await self.wait_overlapped(handle, cast("CData", lpOverlapped))
947947
return lpOverlapped
948948

949949
@_public

src/trio/_core/_local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class RunVar(Generic[T]):
4444
def get(self, default: T | type[_NoValue] = _NoValue) -> T:
4545
"""Gets the value of this :class:`RunVar` for the current run call."""
4646
try:
47-
return cast(T, _run.GLOBAL_RUN_CONTEXT.runner._locals[self])
47+
return cast("T", _run.GLOBAL_RUN_CONTEXT.runner._locals[self])
4848
except AttributeError:
4949
raise RuntimeError("Cannot be used outside of a run context") from None
5050
except KeyError:

src/trio/_core/_run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ def started(self: _TaskStatus[StatusT], value: StatusT) -> None: ...
941941
def started(self, value: StatusT | None = None) -> None:
942942
if self._value is not _NoStatus:
943943
raise RuntimeError("called 'started' twice on the same task status")
944-
self._value = cast(StatusT, value) # If None, StatusT == None
944+
self._value = cast("StatusT", value) # If None, StatusT == None
945945

946946
# If the old nursery is cancelled, then quietly quit now; the child
947947
# will eventually exit on its own, and we don't want to risk moving
@@ -2407,7 +2407,7 @@ def run(
24072407
# Inlined copy of runner.main_task_outcome.unwrap() to avoid
24082408
# cluttering every single Trio traceback with an extra frame.
24092409
if isinstance(runner.main_task_outcome, Value):
2410-
return cast(RetT, runner.main_task_outcome.value)
2410+
return cast("RetT", runner.main_task_outcome.value)
24112411
elif isinstance(runner.main_task_outcome, Error):
24122412
raise runner.main_task_outcome.error
24132413
else: # pragma: no cover
@@ -2531,7 +2531,7 @@ def my_done_callback(run_outcome):
25312531
# this time, so it shouldn't be possible to get an exception here,
25322532
# except for a TrioInternalError.
25332533
next_send = cast(
2534-
EventResult,
2534+
"EventResult",
25352535
None,
25362536
) # First iteration must be `None`, every iteration after that is EventResult
25372537
for _tick in range(5): # expected need is 2 iterations + leave some wiggle room

src/trio/_core/_tests/test_guest_mode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def trio_done_callback(main_outcome: Outcome[T]) -> None:
467467
trio_done_fut.set_result(main_outcome)
468468

469469
if pass_not_threadsafe:
470-
run_sync_soon_not_threadsafe = cast(InHost, loop.call_soon)
470+
run_sync_soon_not_threadsafe = cast("InHost", loop.call_soon)
471471

472472
trio.lowlevel.start_guest_run(
473473
trio_fn,

src/trio/_core/_traps.py

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

55
import enum
66
import types
7-
from collections.abc import Awaitable
87

98
# Jedi gets mad in test_static_tool_sees_class_members if we use collections Callable
109
from typing import TYPE_CHECKING, Any, Callable, NoReturn, Union, cast
@@ -15,7 +14,7 @@
1514
from . import _run
1615

1716
if TYPE_CHECKING:
18-
from collections.abc import Generator
17+
from collections.abc import Awaitable, Generator
1918

2019
from typing_extensions import TypeAlias
2120

@@ -67,7 +66,7 @@ def _real_async_yield(
6766
# Real yield value is from trio's main loop, but type checkers can't
6867
# understand that, so we cast it to make type checkers understand.
6968
_async_yield = cast(
70-
Callable[[MessageType], Awaitable[outcome.Outcome[object]]],
69+
"Callable[[MessageType], Awaitable[outcome.Outcome[object]]]",
7170
_real_async_yield,
7271
)
7372

src/trio/_core/_windows_cffi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,9 @@ class _Overlapped(Protocol):
395395
hEvent: Handle
396396

397397

398-
kernel32 = cast(_Kernel32, ffi.dlopen("kernel32.dll"))
399-
ntdll = cast(_Nt, ffi.dlopen("ntdll.dll"))
400-
ws2_32 = cast(_Ws2, ffi.dlopen("ws2_32.dll"))
398+
kernel32 = cast("_Kernel32", ffi.dlopen("kernel32.dll"))
399+
ntdll = cast("_Nt", ffi.dlopen("ntdll.dll"))
400+
ws2_32 = cast("_Ws2", ffi.dlopen("ws2_32.dll"))
401401

402402
################################################################
403403
# Magic numbers

src/trio/_tests/test_highlevel_open_tcp_listeners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ async def handler(stream: SendStream) -> None:
314314
# nursery.start is incorrectly typed, awaiting #2773
315315
value = await nursery.start(serve_tcp, handler, 0)
316316
assert isinstance(value, list)
317-
listeners = cast(list[SocketListener], value)
317+
listeners = cast("list[SocketListener]", value)
318318
stream = await open_stream_to_socket_listener(listeners[0])
319319
async with stream:
320320
assert await stream.receive_some(1) == b"x"

0 commit comments

Comments
 (0)