From bdc0b482da4a3d7e10bba23ce56c5224e27205da Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:58:16 +0900 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate (#2924) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.11 → v0.1.13](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.11...v0.1.13) * [pre-commit.ci] auto fixes from pre-commit.com hooks * Make CI pass --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: EXPLOSION --- .pre-commit-config.yaml | 2 +- src/trio/_core/_run.py | 9 --------- src/trio/_socket.py | 10 +++++----- src/trio/_subprocess_platform/__init__.py | 6 +++--- test-requirements.txt | 2 +- 5 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ddc5d7fede..251add0e1f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.11 + rev: v0.1.13 hooks: - id: ruff types: [file] diff --git a/src/trio/_core/_run.py b/src/trio/_core/_run.py index c90989e560..72a582ac48 100644 --- a/src/trio/_core/_run.py +++ b/src/trio/_core/_run.py @@ -80,15 +80,6 @@ PosArgT = TypeVarTuple("PosArgT") - # Needs to be guarded, since Unpack[] would be evaluated at runtime. - class _NurseryStartFunc(Protocol[Unpack[PosArgT], StatusT_co]): - """Type of functions passed to `nursery.start() `.""" - - def __call__( - self, *args: Unpack[PosArgT], task_status: TaskStatus[StatusT_co] - ) -> Awaitable[object]: - ... - DEADLINE_HEAP_MIN_PRUNE_THRESHOLD: Final = 1000 diff --git a/src/trio/_socket.py b/src/trio/_socket.py index 1e530b14a1..940a183677 100644 --- a/src/trio/_socket.py +++ b/src/trio/_socket.py @@ -1061,7 +1061,7 @@ def recv(__self, __buflen: int, __flags: int = 0) -> Awaitable[bytes]: # _make_simple_sock_method_wrapper is typed, so this checks that the above is correct # this requires that we refrain from using `/` to specify pos-only # args, or mypy thinks the signature differs from typeshed. - recv = _make_simple_sock_method_wrapper( # noqa: F811 + recv = _make_simple_sock_method_wrapper( _stdlib_socket.socket.recv, _core.wait_readable ) @@ -1076,7 +1076,7 @@ def recv_into( ) -> Awaitable[int]: ... - recv_into = _make_simple_sock_method_wrapper( # noqa: F811 + recv_into = _make_simple_sock_method_wrapper( _stdlib_socket.socket.recv_into, _core.wait_readable ) @@ -1091,7 +1091,7 @@ def recvfrom( ) -> Awaitable[tuple[bytes, AddressFormat]]: ... - recvfrom = _make_simple_sock_method_wrapper( # noqa: F811 + recvfrom = _make_simple_sock_method_wrapper( _stdlib_socket.socket.recvfrom, _core.wait_readable ) @@ -1106,7 +1106,7 @@ def recvfrom_into( ) -> Awaitable[tuple[int, AddressFormat]]: ... - recvfrom_into = _make_simple_sock_method_wrapper( # noqa: F811 + recvfrom_into = _make_simple_sock_method_wrapper( _stdlib_socket.socket.recvfrom_into, _core.wait_readable ) @@ -1158,7 +1158,7 @@ def recvmsg_into( def send(__self, __bytes: Buffer, __flags: int = 0) -> Awaitable[int]: ... - send = _make_simple_sock_method_wrapper( # noqa: F811 + send = _make_simple_sock_method_wrapper( _stdlib_socket.socket.send, _core.wait_writable ) diff --git a/src/trio/_subprocess_platform/__init__.py b/src/trio/_subprocess_platform/__init__.py index 88ff251166..a86772bd55 100644 --- a/src/trio/_subprocess_platform/__init__.py +++ b/src/trio/_subprocess_platform/__init__.py @@ -70,7 +70,7 @@ def create_pipe_from_child_output() -> Tuple["ClosableReceiveStream", int]: try: if sys.platform == "win32": - from .windows import wait_child_exiting # noqa: F811 + from .windows import wait_child_exiting elif sys.platform != "linux" and (TYPE_CHECKING or hasattr(_core, "wait_kevent")): from .kqueue import wait_child_exiting else: @@ -86,11 +86,11 @@ def create_pipe_from_child_output() -> Tuple["ClosableReceiveStream", int]: elif os.name == "posix": - def create_pipe_to_child_stdin(): # noqa: F811 + def create_pipe_to_child_stdin(): rfd, wfd = os.pipe() return trio.lowlevel.FdStream(wfd), rfd - def create_pipe_from_child_output(): # noqa: F811 + def create_pipe_from_child_output(): rfd, wfd = os.pipe() return trio.lowlevel.FdStream(rfd), wfd diff --git a/test-requirements.txt b/test-requirements.txt index 88da8d534a..d5a55d220d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -120,7 +120,7 @@ pytz==2023.3.post1 # via babel requests==2.31.0 # via sphinx -ruff==0.1.9 +ruff==0.1.13 # via -r test-requirements.in sniffio==1.3.0 # via -r test-requirements.in From 65473137e395486a0db2385066d32361d99f7296 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 05:52:12 +0000 Subject: [PATCH 2/2] Dependency updates (#2927) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- docs-requirements.txt | 2 +- test-requirements.txt | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs-requirements.txt b/docs-requirements.txt index 2934151264..7ba7beb38a 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -42,7 +42,7 @@ importlib-resources==6.1.1 # via towncrier incremental==22.10.0 # via towncrier -jinja2==3.1.2 +jinja2==3.1.3 # via # -r docs-requirements.in # sphinx diff --git a/test-requirements.txt b/test-requirements.txt index d5a55d220d..a43edbc212 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -67,7 +67,7 @@ isort==5.13.2 # via pylint jedi==0.19.1 # via -r test-requirements.in -jinja2==3.1.2 +jinja2==3.1.3 # via sphinx markupsafe==2.1.3 # via jinja2 @@ -112,7 +112,7 @@ pyopenssl==23.3.0 # via -r test-requirements.in pyproject-hooks==1.0.0 # via build -pyright==1.1.344 +pyright==1.1.347 # via -r test-requirements.in pytest==7.4.4 # via -r test-requirements.in @@ -155,13 +155,13 @@ tomlkit==0.12.3 # via pylint trustme==1.1.0 # via -r test-requirements.in -types-cffi==1.16.0.0 ; implementation_name == "cpython" +types-cffi==1.16.0.20240106 ; implementation_name == "cpython" # via -r test-requirements.in -types-docutils==0.20.0.3 +types-docutils==0.20.0.20240106 # via -r test-requirements.in -types-pyopenssl==23.3.0.0 ; implementation_name == "cpython" +types-pyopenssl==23.3.0.20240106 ; implementation_name == "cpython" # via -r test-requirements.in -types-setuptools==69.0.0.0 +types-setuptools==69.0.0.20240115 # via types-cffi typing-extensions==4.9.0 # via