Skip to content

Commit b9ed3cd

Browse files
[pre-commit.ci] pre-commit autoupdate (#256)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](astral-sh/ruff-pre-commit@v0.2.2...v0.3.2) - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](pre-commit/mirrors-mypy@v1.8.0...v1.9.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f062fb8 commit b9ed3cd

21 files changed

+45
-40
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
hooks:
1414
- id: check-yaml
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.2.2
16+
rev: v0.3.2
1717
hooks:
1818
- id: ruff
1919
args: [ --fix ]
@@ -26,7 +26,7 @@ repos:
2626
args: ["--ignore", "D001"]
2727

2828
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: 'v1.8.0'
29+
rev: 'v1.9.0'
3030
hooks:
3131
- id: mypy
3232
additional_dependencies:

doc/example/popen_read_multiple.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
reading results from possibly blocking code running in sub processes.
55
"""
6+
67
import execnet
78

89
NUM_PROCESSES = 5

doc/example/redirect_remote_output.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- setting a callback for receiving channel data
88
99
"""
10+
1011
import execnet
1112

1213
gw = execnet.makegateway()

doc/example/svn-sync-repo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
uses execnet.
66
77
"""
8+
89
import os
910
import pathlib
1011
import subprocess

doc/example/sysinfo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
(c) Holger Krekel, MIT license
77
"""
8+
89
import optparse
910
import re
1011
import sys

src/execnet/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
(c) 2012, Holger Krekel and others
88
"""
9+
910
from ._version import version as __version__
1011
from .gateway_base import DataFormatError
1112
from .gateway_base import RemoteError

src/execnet/gateway.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
gateway code for initiating popen, socket and ssh connections.
33
(c) 2004-2013, Holger Krekel and others
44
"""
5+
56
from __future__ import annotations
67

78
import inspect
@@ -48,9 +49,7 @@ def __repr__(self) -> str:
4849
except AttributeError:
4950
r = "uninitialized"
5051
i = "no"
51-
return "<{} id={!r} {}, {} model, {} active channels>".format(
52-
self.__class__.__name__, self.id, r, self.execmodel.backend, i
53-
)
52+
return f"<{self.__class__.__name__} id={self.id!r} {r}, {self.execmodel.backend} model, {i} active channels>"
5453

5554
def exit(self) -> None:
5655
"""trigger gateway exit. Defer waiting for finishing
@@ -166,8 +165,7 @@ def __repr__(self) -> str:
166165

167166
if TYPE_CHECKING:
168167

169-
def __getattr__(self, name: str) -> Any:
170-
...
168+
def __getattr__(self, name: str) -> Any: ...
171169

172170

173171
RemoteStatus = RInfo

src/execnet/gateway_base.py

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Ronny Pfannschmidt
1212
- many others
1313
"""
14+
1415
from __future__ import annotations
1516

1617
import abc
@@ -32,51 +33,39 @@
3233

3334

3435
class WriteIO(Protocol):
35-
def write(self, data: bytes, /) -> None:
36-
...
36+
def write(self, data: bytes, /) -> None: ...
3737

3838

3939
class ReadIO(Protocol):
40-
def read(self, numbytes: int, /) -> bytes:
41-
...
40+
def read(self, numbytes: int, /) -> bytes: ...
4241

4342

4443
class IO(Protocol):
4544
execmodel: ExecModel
4645

47-
def read(self, numbytes: int, /) -> bytes:
48-
...
46+
def read(self, numbytes: int, /) -> bytes: ...
4947

50-
def write(self, data: bytes, /) -> None:
51-
...
48+
def write(self, data: bytes, /) -> None: ...
5249

53-
def close_read(self) -> None:
54-
...
50+
def close_read(self) -> None: ...
5551

56-
def close_write(self) -> None:
57-
...
52+
def close_write(self) -> None: ...
5853

59-
def wait(self) -> int | None:
60-
...
54+
def wait(self) -> int | None: ...
6155

62-
def kill(self) -> None:
63-
...
56+
def kill(self) -> None: ...
6457

6558

6659
class Event(Protocol):
6760
"""Protocol for types which look like threading.Event."""
6861

69-
def is_set(self) -> bool:
70-
...
62+
def is_set(self) -> bool: ...
7163

72-
def set(self) -> None:
73-
...
64+
def set(self) -> None: ...
7465

75-
def clear(self) -> None:
76-
...
66+
def clear(self) -> None: ...
7767

78-
def wait(self, timeout: float | None = None) -> bool:
79-
...
68+
def wait(self, timeout: float | None = None) -> bool: ...
8069

8170

8271
class ExecModel(metaclass=abc.ABCMeta):
@@ -973,9 +962,9 @@ def reconfigure(
973962

974963
class ChannelFactory:
975964
def __init__(self, gateway: BaseGateway, startcount: int = 1) -> None:
976-
self._channels: weakref.WeakValueDictionary[
977-
int, Channel
978-
] = weakref.WeakValueDictionary()
965+
self._channels: weakref.WeakValueDictionary[int, Channel] = (
966+
weakref.WeakValueDictionary()
967+
)
979968
# Channel ID => (callback, end marker, strconfig)
980969
self._callbacks: dict[
981970
int, tuple[Callable[[Any], Any], object, tuple[bool, bool]]

src/execnet/gateway_bootstrap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
code to initialize the remote side of a gateway once the io is created
33
"""
4+
45
from __future__ import annotations
56

67
import inspect

src/execnet/gateway_io.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
creates io instances used for gateway io
55
"""
6+
67
from __future__ import annotations
78

89
import shlex

0 commit comments

Comments
 (0)