99import sysconfig
1010from contextlib import closing
1111from pathlib import Path
12- from subprocess import PIPE , Popen , run # noqa: S404
12+ from subprocess import PIPE , Popen , run # ruff:ignore[suspicious-subprocess-import]
1313from threading import Thread
1414from typing import IO , TYPE_CHECKING , cast
1515
2626
2727
2828def _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
3232class 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
0 commit comments