Skip to content

Commit 316a5f1

Browse files
committed
Update mcpgateway.translate lint
Signed-off-by: Mihai Criveti <[email protected]>
1 parent e73df5a commit 316a5f1

File tree

5 files changed

+68
-84
lines changed

5 files changed

+68
-84
lines changed

mcpgateway/translate.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ async def publish(self, data: str) -> None:
9292
9393
Args:
9494
data: The data string to publish to all subscribers.
95-
96-
Returns:
97-
None
9895
"""
9996
dead: List[asyncio.Queue[str]] = []
10097
for q in self._subscribers:
@@ -121,9 +118,6 @@ def unsubscribe(self, q: "asyncio.Queue[str]") -> None:
121118
122119
Args:
123120
q: The queue to unsubscribe from published data.
124-
125-
Returns:
126-
None
127121
"""
128122
with suppress(ValueError):
129123
self._subscribers.remove(q)
@@ -146,12 +140,6 @@ async def start(self) -> None:
146140
"""Start the stdio subprocess.
147141
148142
Creates the subprocess and starts the stdout pump task.
149-
150-
Returns:
151-
None
152-
153-
Raises:
154-
OSError: If the subprocess cannot be started.
155143
"""
156144
LOGGER.info("Starting stdio subprocess: %s", self._cmd)
157145
self._proc = await asyncio.create_subprocess_exec(
@@ -168,9 +156,6 @@ async def stop(self) -> None:
168156
"""Stop the stdio subprocess.
169157
170158
Terminates the subprocess and cancels the pump task.
171-
172-
Returns:
173-
None
174159
"""
175160
if self._proc is None:
176161
return
@@ -187,9 +172,6 @@ async def send(self, raw: str) -> None:
187172
Args:
188173
raw: The raw data string to send to the subprocess.
189174
190-
Returns:
191-
None
192-
193175
Raises:
194176
RuntimeError: If the stdio endpoint is not started.
195177
"""
@@ -205,11 +187,8 @@ async def _pump_stdout(self) -> None:
205187
Continuously reads lines from the subprocess stdout and publishes them
206188
to the pubsub system.
207189
208-
Returns:
209-
None
210-
211190
Raises:
212-
Exception: If the stdout pump encounters an error.
191+
asyncio.CancelledError: If the pump task is cancelled.
213192
"""
214193
assert self._proc and self._proc.stdout
215194
reader = self._proc.stdout
@@ -225,7 +204,6 @@ async def _pump_stdout(self) -> None:
225204
raise
226205
except Exception: # pragma: no cover --best-effort logging
227206
LOGGER.exception("stdout pump crashed - terminating bridge")
228-
raise
229207

230208

231209
# ---------------------------------------------------------------------------#
@@ -419,9 +397,6 @@ async def _run_stdio_to_sse(cmd: str, port: int, log_level: str = "info", cors:
419397
port: The port to bind the HTTP server to.
420398
log_level: The logging level to use. Defaults to "info".
421399
cors: Optional list of CORS allowed origins.
422-
423-
Returns:
424-
None
425400
"""
426401
pubsub = _PubSub()
427402
stdio = StdIOEndpoint(cmd, pubsub)
@@ -464,9 +439,6 @@ async def _run_sse_to_stdio(url: str, oauth2_bearer: Optional[str]) -> None:
464439
url: The SSE endpoint URL to connect to.
465440
oauth2_bearer: Optional OAuth2 bearer token for authentication.
466441
467-
Returns:
468-
None
469-
470442
Raises:
471443
ImportError: If httpx package is not available.
472444
"""
@@ -516,7 +488,7 @@ def start_stdio(cmd, port, log_level, cors):
516488
cors: Optional list of CORS allowed origins.
517489
518490
Returns:
519-
None
491+
None: This function does not return a value.
520492
"""
521493
return asyncio.run(_run_stdio_to_sse(cmd, port, log_level, cors))
522494

@@ -529,7 +501,7 @@ def start_sse(url, bearer):
529501
bearer: Optional OAuth2 bearer token for authentication.
530502
531503
Returns:
532-
None
504+
None: This function does not return a value.
533505
"""
534506
return asyncio.run(_run_sse_to_stdio(url, bearer))
535507

@@ -539,13 +511,6 @@ def main(argv: Optional[Sequence[str]] | None = None) -> None:
539511
540512
Args:
541513
argv: Optional sequence of command line arguments. If None, uses sys.argv[1:].
542-
543-
Returns:
544-
None
545-
546-
Raises:
547-
NotImplementedError: If an unsupported option is specified.
548-
KeyboardInterrupt: If the user interrupts the process.
549514
"""
550515
args = _parse_args(argv or sys.argv[1:])
551516
logging.basicConfig(

0 commit comments

Comments
 (0)