Skip to content

Commit 6c63ef5

Browse files
committed
cleaned up underscore prefixes: renamed sync and async modules, and added protocol interface for devbox cmd/file/net
1 parent c445b71 commit 6c63ef5

File tree

10 files changed

+328
-22
lines changed

10 files changed

+328
-22
lines changed

src/runloop_api_client/sdk/__init__.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3-
from ._sync import RunloopSDK, DevboxClient, SnapshotClient, BlueprintClient, StorageObjectClient
4-
from ._async import (
3+
from .sync import RunloopSDK, DevboxClient, SnapshotClient, BlueprintClient, StorageObjectClient
4+
from .async_ import (
55
AsyncRunloopSDK,
66
AsyncDevboxClient,
77
AsyncSnapshotClient,
@@ -22,26 +22,29 @@
2222
from .async_execution_result import AsyncExecutionResult
2323

2424
__all__ = [
25+
# Main SDK entry points
2526
"RunloopSDK",
2627
"AsyncRunloopSDK",
27-
"Devbox",
28+
# Management interfaces
2829
"DevboxClient",
29-
"Execution",
30-
"ExecutionResult",
31-
"Blueprint",
30+
"AsyncDevboxClient",
3231
"BlueprintClient",
33-
"Snapshot",
32+
"AsyncBlueprintClient",
3433
"SnapshotClient",
35-
"StorageObject",
34+
"AsyncSnapshotClient",
3635
"StorageObjectClient",
36+
"AsyncStorageObjectClient",
37+
# Resource classes
38+
"Devbox",
3739
"AsyncDevbox",
38-
"AsyncDevboxClient",
40+
"Execution",
3941
"AsyncExecution",
42+
"ExecutionResult",
4043
"AsyncExecutionResult",
44+
"Blueprint",
4145
"AsyncBlueprint",
42-
"AsyncBlueprintClient",
46+
"Snapshot",
4347
"AsyncSnapshot",
44-
"AsyncSnapshotClient",
48+
"StorageObject",
4549
"AsyncStorageObject",
46-
"AsyncStorageObjectClient",
4750
]

src/runloop_api_client/sdk/async_blueprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async def create_devbox(
104104
timeout: float | Timeout | None | NotGiven = not_given,
105105
idempotency_key: str | None = None,
106106
) -> "AsyncDevbox":
107-
from ._async import AsyncDevboxClient
107+
from .async_ import AsyncDevboxClient
108108

109109
devbox_client = AsyncDevboxClient(self._client)
110110
return await devbox_client.create_from_blueprint_id(

src/runloop_api_client/sdk/async_devbox.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from .._types import Body, Omit, Query, Headers, Timeout, NotGiven, FileTypes, omit, not_given
1515
from .._client import AsyncRunloop
1616
from ._helpers import LogCallback
17+
from .protocols import AsyncFileInterface, AsyncCommandInterface, AsyncNetworkInterface
1718
from .._streaming import AsyncStream
1819
from ..lib.polling import PollingConfig
1920
from .async_execution import AsyncExecution, _AsyncStreamingGroup
@@ -221,15 +222,15 @@ async def close(self) -> None:
221222
await self.shutdown()
222223

223224
@property
224-
def cmd(self) -> "_AsyncCommandInterface":
225+
def cmd(self) -> AsyncCommandInterface:
225226
return _AsyncCommandInterface(self)
226227

227228
@property
228-
def file(self) -> "_AsyncFileInterface":
229+
def file(self) -> AsyncFileInterface:
229230
return _AsyncFileInterface(self)
230231

231232
@property
232-
def net(self) -> "_AsyncNetworkInterface":
233+
def net(self) -> AsyncNetworkInterface:
233234
return _AsyncNetworkInterface(self)
234235

235236
# ------------------------------------------------------------------ #

src/runloop_api_client/sdk/async_snapshot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ async def create_devbox(
132132
timeout: float | Timeout | None | NotGiven = not_given,
133133
idempotency_key: str | None = None,
134134
) -> "AsyncDevbox":
135-
from ._async import AsyncDevboxClient
135+
from .async_ import AsyncDevboxClient
136136

137137
devbox_client = AsyncDevboxClient(self._client)
138138
return await devbox_client.create_from_snapshot(

src/runloop_api_client/sdk/blueprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def create_devbox(
104104
timeout: float | Timeout | None | NotGiven = not_given,
105105
idempotency_key: str | None = None,
106106
) -> "Devbox":
107-
from ._sync import DevboxClient
107+
from .sync import DevboxClient
108108

109109
devbox_client = DevboxClient(self._client)
110110
return devbox_client.create_from_blueprint_id(

src/runloop_api_client/sdk/devbox.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from .._client import Runloop
1616
from ._helpers import LogCallback
1717
from .execution import Execution, _StreamingGroup
18+
from .protocols import FileInterface, CommandInterface, NetworkInterface
1819
from .._streaming import Stream
1920
from ..lib.polling import PollingConfig
2021
from .execution_result import ExecutionResult
@@ -313,15 +314,15 @@ def close(self) -> None:
313314
self.shutdown()
314315

315316
@property
316-
def cmd(self) -> "_CommandInterface":
317+
def cmd(self) -> CommandInterface:
317318
return _CommandInterface(self)
318319

319320
@property
320-
def file(self) -> "_FileInterface":
321+
def file(self) -> FileInterface:
321322
return _FileInterface(self)
322323

323324
@property
324-
def net(self) -> "_NetworkInterface":
325+
def net(self) -> NetworkInterface:
325326
return _NetworkInterface(self)
326327

327328
# --------------------------------------------------------------------- #

0 commit comments

Comments
 (0)