Skip to content

Commit b633192

Browse files
chore: auto fixes from pre-commit.com hooks
1 parent 2359e1a commit b633192

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/subprocess_tee/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
import subprocess # noqa: S404
1212
import sys
1313
from asyncio import StreamReader
14+
from collections.abc import Sequence
1415
from importlib.metadata import PackageNotFoundError, version
1516
from pathlib import Path
1617
from shlex import join
17-
from typing import TYPE_CHECKING, Any, Sequence
18+
from typing import TYPE_CHECKING, Any
1819

1920
try:
2021
__version__ = version("subprocess-tee")
@@ -26,6 +27,7 @@
2627

2728
if TYPE_CHECKING:
2829
from collections.abc import Callable
30+
2931
from subprocess_tee._types import StrOrBytesPath
3032
CompletedProcess = subprocess.CompletedProcess
3133

@@ -41,7 +43,7 @@ async def _read_stream(stream: StreamReader, callback: Callable[..., Any]) -> No
4143
break
4244

4345

44-
async def _stream_subprocess( # noqa: C901, R0913, R0914
46+
async def _stream_subprocess( # noqa: C901
4547
args: StrOrBytesPath | Sequence[StrOrBytesPath],
4648
*,
4749
stdin=None,
@@ -201,7 +203,11 @@ def run(
201203
check = kwargs.get("check", False)
202204

203205
if kwargs.pop("echo", False):
204-
cmd = args if isinstance(args, (str, bytes, os.PathLike)) else join(str(s) for s in args)
206+
cmd = (
207+
args
208+
if isinstance(args, (str, bytes, os.PathLike))
209+
else join(str(s) for s in args)
210+
)
205211
print(f"COMMAND: {cmd}") # noqa: T201
206212

207213
result = asyncio.run(_stream_subprocess(args, **kwargs))

src/subprocess_tee/_types.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""Internally used types."""
22

33
# Source from https://github.com/python/typing/issues/256#issuecomment-1442633430
4-
from collections.abc import Iterator, Sequence
5-
from typing import Any, Protocol, SupportsIndex, TypeVar, overload, Union
64
from os import PathLike
5+
from typing import TypeVar, Union
76

87
_T_co = TypeVar("_T_co", covariant=True)
98

0 commit comments

Comments
 (0)