Skip to content

Commit 5372565

Browse files
author
Operations Center Bot
committed
fix(ci): auto-fix ruff lint violations on fix/ci-boundary-b64
1 parent 669d2de commit 5372565

15 files changed

Lines changed: 285 additions & 195 deletions

src/core_runner/contracts/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
``pending | running | succeeded | failed | timed_out | cancelled |
1111
rejected``.
1212
"""
13+
1314
from core_runner.contracts.invocation import RuntimeInvocation
1415
from core_runner.contracts.result import ArtifactDescriptor, RuntimeResult
1516

src/core_runner/contracts/invocation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import RuntimeInvocation`` without depending on the RxP package
66
directly.
77
"""
8+
89
from rxp.contracts import RuntimeInvocation
910

1011
__all__ = ["RuntimeInvocation"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-License-Identifier: AGPL-3.0-or-later
22
"""CoreRunner returns the canonical RxP RuntimeResult contract."""
3+
34
from rxp.contracts import ArtifactDescriptor, RuntimeResult
45

56
__all__ = ["RuntimeResult", "ArtifactDescriptor"]

src/core_runner/process.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Transient SIGTERM handler — child group is killed if the Python supervisor
1313
is itself killed (OOM killer, supervisor stop)
1414
"""
15+
1516
from __future__ import annotations
1617

1718
import os

src/core_runner/runners/async_http_runner.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
5858
Each call uses a short-lived ``httpx.Client``; no global state.
5959
"""
60+
6061
from __future__ import annotations
6162

6263
import json
@@ -97,8 +98,7 @@ def __init__(
9798
) -> None:
9899
if httpx is None and client is None:
99100
raise ImportError(
100-
"AsyncHttpRunner requires httpx. Install with "
101-
"`pip install core-runner[http]`"
101+
"AsyncHttpRunner requires httpx. Install with `pip install core-runner[http]`"
102102
)
103103
self._follow_redirects = follow_redirects
104104
self._verify = verify
@@ -137,12 +137,11 @@ def run(self, invocation: RuntimeInvocation) -> RuntimeResult:
137137

138138
pending_raw = meta.get("http.poll_pending_codes") or ""
139139
try:
140-
pending_codes = tuple(
141-
int(s.strip()) for s in pending_raw.split(",") if s.strip()
142-
)
140+
pending_codes = tuple(int(s.strip()) for s in pending_raw.split(",") if s.strip())
143141
except ValueError:
144142
return _rejected(
145-
invocation, started,
143+
invocation,
144+
started,
146145
"http.poll_pending_codes must be comma-separated integers",
147146
)
148147

@@ -187,18 +186,22 @@ def run(self, invocation: RuntimeInvocation) -> RuntimeResult:
187186
# - server acknowledged async dispatch (status field absent
188187
# or non-terminal, e.g. Archon's {accepted, status:"started"})
189188
if _is_synchronous_terminal(
190-
kickoff_resp, poll_status_path, terminal_states,
189+
kickoff_resp,
190+
poll_status_path,
191+
terminal_states,
191192
):
192193
return _terminal_from_kickoff(
193-
invocation, started, kickoff_resp,
194-
success_states, poll_status_path,
194+
invocation,
195+
started,
196+
kickoff_resp,
197+
success_states,
198+
poll_status_path,
195199
)
196200
# Fall through to poll loop — kickoff was an ack, not a result.
197201
elif kickoff_resp.status_code != 202:
198202
preview = kickoff_resp.text[:200] if kickoff_resp.text else ""
199203
msg = (
200-
f"kickoff expected 202 (or 200), got HTTP "
201-
f"{kickoff_resp.status_code}: {preview}"
204+
f"kickoff expected 202 (or 200), got HTTP {kickoff_resp.status_code}: {preview}"
202205
).strip()
203206
return _failed(invocation, started, msg)
204207

@@ -208,7 +211,8 @@ def run(self, invocation: RuntimeInvocation) -> RuntimeResult:
208211
run_id_path = meta.get("http.poll_run_id_path")
209212
if not run_id_path:
210213
return _rejected(
211-
invocation, started,
214+
invocation,
215+
started,
212216
"poll_url_template contains {run_id} but no poll_run_id_path provided",
213217
)
214218
try:
@@ -228,7 +232,9 @@ def run(self, invocation: RuntimeInvocation) -> RuntimeResult:
228232
while True:
229233
if _deadline_exceeded(deadline_monotonic):
230234
return _timed_out(
231-
invocation, started, timeout,
235+
invocation,
236+
started,
237+
timeout,
232238
TimeoutError("poll loop deadline exceeded"),
233239
"poll",
234240
)
@@ -249,7 +255,8 @@ def run(self, invocation: RuntimeInvocation) -> RuntimeResult:
249255
continue
250256
preview = poll_resp.text[:200] if poll_resp.text else ""
251257
return _failed(
252-
invocation, started,
258+
invocation,
259+
started,
253260
f"poll expected HTTP 200, got {poll_resp.status_code}: {preview}".strip(),
254261
)
255262
try:
@@ -260,8 +267,7 @@ def run(self, invocation: RuntimeInvocation) -> RuntimeResult:
260267
status = _extract_path(poll_payload, poll_status_path)
261268
if status is None:
262269
msg = (
263-
f"poll response has no field at path "
264-
f"{poll_status_path!r}: {poll_payload!r}"
270+
f"poll response has no field at path {poll_status_path!r}: {poll_payload!r}"
265271
)
266272
return _failed(invocation, started, msg)
267273
status_str = str(status)
@@ -280,8 +286,7 @@ def run(self, invocation: RuntimeInvocation) -> RuntimeResult:
280286
stderr_path=None,
281287
artifacts=[],
282288
error_summary=(
283-
None if success
284-
else f"backend reported terminal status: {status_str}"
289+
None if success else f"backend reported terminal status: {status_str}"
285290
),
286291
)
287292

@@ -454,9 +459,7 @@ def _timed_out(
454459
phase: str,
455460
) -> RuntimeResult:
456461
note = (
457-
f"{phase} exceeded timeout of {timeout}s: {exc}"
458-
if timeout
459-
else f"{phase} timed out: {exc}"
462+
f"{phase} exceeded timeout of {timeout}s: {exc}" if timeout else f"{phase} timed out: {exc}"
460463
)
461464
return RuntimeResult(
462465
invocation_id=invocation.invocation_id,

src/core_runner/runners/http_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
This runner installs no global state. Each ``run`` opens a short-lived
1818
``httpx.Client`` so timeout/cancellation semantics are local to the call.
1919
"""
20+
2021
from __future__ import annotations
2122

2223
import json
@@ -50,8 +51,7 @@ def __init__(
5051
) -> None:
5152
if httpx is None and client is None:
5253
raise ImportError(
53-
"HttpRunner requires httpx. Install with "
54-
"`pip install core-runner[http]`"
54+
"HttpRunner requires httpx. Install with `pip install core-runner[http]`"
5555
)
5656
self._follow_redirects = follow_redirects
5757
self._verify = verify

src/core_runner/runners/manual_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
``HttpRunner`` / ``ContainerRunner`` will cover ``"http"`` /
1212
``"container"`` with concrete implementations.
1313
"""
14+
1415
from __future__ import annotations
1516

1617
from collections.abc import Callable

src/core_runner/runners/subprocess_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
Provides stdout/stderr capture to files and ArtifactDescriptor production
66
on top of the process-group-safe safe_run() primitive.
77
"""
8+
89
from __future__ import annotations
910

10-
import os
1111
from datetime import UTC, datetime
1212
from pathlib import Path
1313

src/core_runner/runtime.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
than raising — same posture as the missing-working-directory check
1313
in ``SubprocessRunner``.
1414
"""
15+
1516
from __future__ import annotations
1617

1718
from datetime import UTC, datetime

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Refuses to run unless invoked from inside this project's `.venv` —
66
prevents accidental test runs against the global interpreter.
77
"""
8+
89
from __future__ import annotations
910

1011
import os

0 commit comments

Comments
 (0)