Skip to content

Commit 3b8661c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 65d022c commit 3b8661c

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/devpi_process/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import sysconfig
1010
from contextlib import closing
1111
from pathlib import Path
12-
from subprocess import PIPE, Popen, run # noqa: S404
12+
from subprocess import PIPE, Popen, run # ruff:ignore[suspicious-subprocess-import]
1313
from threading import Thread
1414
from typing import IO, TYPE_CHECKING, cast
1515

@@ -26,7 +26,7 @@
2626

2727

2828
def _check_call(cmd: list[str]) -> None:
29-
run(cmd, check=True, capture_output=True) # noqa: S603
29+
run(cmd, check=True, capture_output=True) # ruff:ignore[subprocess-without-shell-equals-true]
3030

3131

3232
class Index:
@@ -75,7 +75,7 @@ class IndexServer:
7575
def __init__(
7676
self,
7777
path: Path,
78-
with_root_pypi: bool = False, # noqa: FBT001, FBT002
78+
with_root_pypi: bool = False, # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument]
7979
start_args: Sequence[str] | None = None,
8080
) -> None:
8181
"""
@@ -90,7 +90,7 @@ def __init__(
9090
self._start_args: Sequence[str] = [] if start_args is None else start_args
9191

9292
self.host, self.port = "localhost", _find_free_port()
93-
self._passwd = "".join(random.choices(string.ascii_letters, k=8)) # noqa: S311
93+
self._passwd = "".join(random.choices(string.ascii_letters, k=8)) # ruff:ignore[suspicious-non-cryptographic-random-usage]
9494

9595
scripts_dir = sysconfig.get_path("scripts")
9696
if scripts_dir is None:
@@ -134,7 +134,7 @@ def _create_and_start_server(self) -> None:
134134
# 2. start the server
135135
cmd = [self._server, "--serverdir", server_at, "--port", str(self.port)]
136136
cmd.extend(self._start_args)
137-
self._process = Popen(cmd, stdout=PIPE, universal_newlines=True) # noqa: S603
137+
self._process = Popen(cmd, stdout=PIPE, universal_newlines=True) # ruff:ignore[subprocess-without-shell-equals-true]
138138
stdout = self._drain_stdout()
139139
for line in stdout: # pragma: no branch # will always loop at least once
140140
if "serving at url" in line:
@@ -153,7 +153,7 @@ def _drain_stdout(self) -> Iterator[str]:
153153
stdout = cast("IO[str]", process.stdout)
154154
while True:
155155
if process.poll() is not None: # pragma: no cover
156-
print(f"devpi server with pid {process.pid} at {self._server_dir} died") # noqa: T201
156+
print(f"devpi server with pid {process.pid} at {self._server_dir} died") # ruff:ignore[print]
157157
break
158158
yield stdout.readline()
159159

tests/demo_pkg_inline/build.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050

5151
def build_wheel(
5252
wheel_directory: str,
53-
metadata_directory: str | None = None, # noqa: ARG001
54-
config_settings: None = None, # noqa: ARG001
53+
metadata_directory: str | None = None, # ruff:ignore[unused-function-argument]
54+
config_settings: None = None, # ruff:ignore[unused-function-argument]
5555
) -> str:
5656
base_name = f"{name}-{version}-py{sys.version_info[0]}-none-any.whl"
5757
path = Path(wheel_directory) / base_name
@@ -62,14 +62,14 @@ def build_wheel(
6262

6363

6464
def get_requires_for_build_wheel(
65-
config_settings: None = None, # noqa: ARG001
65+
config_settings: None = None, # ruff:ignore[unused-function-argument]
6666
) -> list[str]:
6767
return [] # pragma: no cover # only executed in non-host pythons
6868

6969

7070
def build_sdist(
7171
sdist_directory: str,
72-
config_settings: None = None, # noqa: ARG001
72+
config_settings: None = None, # ruff:ignore[unused-function-argument]
7373
) -> str:
7474
result = f"{name}-{version}.tar.gz"
7575
with tarfile.open(str(Path(sdist_directory) / result), "w:gz") as tar:
@@ -86,6 +86,6 @@ def build_sdist(
8686

8787

8888
def get_requires_for_build_sdist(
89-
config_settings: None = None, # noqa: ARG001
89+
config_settings: None = None, # ruff:ignore[unused-function-argument]
9090
) -> list[str]:
9191
return [] # pragma: no cover # only executed in non-host pythons

tests/test_devpi_process.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
def test_version() -> None:
17-
import devpi_process # noqa: PLC0415
17+
import devpi_process # ruff:ignore[import-outside-top-level]
1818

1919
assert devpi_process.__version__ is not None
2020

@@ -69,7 +69,7 @@ def test_create_server_with_pypi(tmp_path: Path) -> None:
6969

7070
def test_create_server_start_args(tmp_path: Path) -> None:
7171
with IndexServer(tmp_path, start_args=["--offline-mode"]) as server:
72-
assert server._process is not None # noqa: SLF001
73-
args = server._process.args # noqa: SLF001
72+
assert server._process is not None # ruff:ignore[private-member-access]
73+
args = server._process.args # ruff:ignore[private-member-access]
7474
assert isinstance(args, list)
7575
assert args[-1] == "--offline-mode"

0 commit comments

Comments
 (0)