Skip to content

Commit bb09391

Browse files
Reflexcursoragent
andcommitted
chore: apply ruff format to bulkhead pool changes
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6783ef6 commit bb09391

3 files changed

Lines changed: 7 additions & 21 deletions

File tree

src/runloop_api_client/_base_client.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,9 +1847,7 @@ def _ensure_background_client(self, shard: int) -> httpx.AsyncClient:
18471847
except RuntimeError:
18481848
loop = None
18491849
if loop is not None:
1850-
transport = _acquire_shared_async_transport(
1851-
_shared_async_background_transports, loop, shard
1852-
)
1850+
transport = _acquire_shared_async_transport(_shared_async_background_transports, loop, shard)
18531851
client = self._make_bulkhead_client(transport=transport)
18541852
self._background_clients[shard] = client
18551853
return client
@@ -1865,9 +1863,7 @@ def _ensure_transfer_client(self, shard: int) -> httpx.AsyncClient:
18651863
except RuntimeError:
18661864
loop = None
18671865
if loop is not None:
1868-
transport = _acquire_shared_async_transport(
1869-
_shared_async_transfer_transports, loop, shard
1870-
)
1866+
transport = _acquire_shared_async_transport(_shared_async_transfer_transports, loop, shard)
18711867
client = self._make_bulkhead_client(transport=transport)
18721868
self._transfer_clients[shard] = client
18731869
return client

src/runloop_api_client/_client.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,7 @@ def copy(
335335
http_client=http_client,
336336
shared_http_pool=resolved_shared,
337337
background_pool_shards=(
338-
background_pool_shards
339-
if background_pool_shards is not None
340-
else self._background_pool_shards
338+
background_pool_shards if background_pool_shards is not None else self._background_pool_shards
341339
),
342340
transfer_pool_shards=(
343341
transfer_pool_shards if transfer_pool_shards is not None else self._transfer_pool_shards
@@ -645,9 +643,7 @@ def copy(
645643
http_client=http_client,
646644
shared_http_pool=resolved_shared,
647645
background_pool_shards=(
648-
background_pool_shards
649-
if background_pool_shards is not None
650-
else self._background_pool_shards
646+
background_pool_shards if background_pool_shards is not None else self._background_pool_shards
651647
),
652648
transfer_pool_shards=(
653649
transfer_pool_shards if transfer_pool_shards is not None else self._transfer_pool_shards

tests/test_transfer_client.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,8 @@ def test_api_background_transfer_use_distinct_transports() -> None:
9696
def test_same_resource_affinity_uses_same_shard() -> None:
9797
client = _make_client(background_pool_shards=2, transfer_pool_shards=2)
9898
try:
99-
w1 = client._send_client_for_request(
100-
httpx.Request("POST", f"{base_url}/v1/devboxes/dbx_same/wait_for_status")
101-
)
102-
w2 = client._send_client_for_request(
103-
httpx.Request("POST", f"{base_url}/v1/devboxes/dbx_same/wait_for_status")
104-
)
99+
w1 = client._send_client_for_request(httpx.Request("POST", f"{base_url}/v1/devboxes/dbx_same/wait_for_status"))
100+
w2 = client._send_client_for_request(httpx.Request("POST", f"{base_url}/v1/devboxes/dbx_same/wait_for_status"))
105101
assert w1 is w2
106102
finally:
107103
client.close()
@@ -161,9 +157,7 @@ async def test_async_bulkheads() -> None:
161157
wait = client._send_client_for_request(
162158
httpx.Request("POST", f"{base_url}/v1/devboxes/dbx_1/executions/ex_1/wait_for_status")
163159
)
164-
upload = client._send_client_for_request(
165-
httpx.Request("POST", f"{base_url}/v1/devboxes/dbx_1/upload_file")
166-
)
160+
upload = client._send_client_for_request(httpx.Request("POST", f"{base_url}/v1/devboxes/dbx_1/upload_file"))
167161
assert wait is not client._client
168162
assert upload is not client._client
169163
assert wait is not upload

0 commit comments

Comments
 (0)