Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions boxd/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from typing import Any

class ProxyEntry:
name: str
port: int

def __init__(self, name: str, port: int) -> None: ...

class NetworkConfig:
proxies: list[ProxyEntry] | None

def __init__(self, proxies: list[ProxyEntry] | None = ...) -> None: ...

class LifecycleConfig:
auto_suspend_timeout: int | None

def __init__(self, auto_suspend_timeout: int | None = ...) -> None: ...

class BoxConfig:
vcpu: int | None
memory: str | None
disk: str | None
lifecycle: LifecycleConfig | None
network: NetworkConfig | None

def __init__(
self,
*,
vcpu: int | None = ...,
memory: str | None = ...,
disk: str | None = ...,
lifecycle: LifecycleConfig | None = ...,
network: NetworkConfig | None = ...,
**kwargs: Any,
) -> None: ...
8 changes: 8 additions & 0 deletions boxd/aio.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from typing import Any

class Compute:
box: Any

def __init__(self, **kwargs: Any) -> None: ...
async def __aenter__(self) -> "Compute": ...
async def __aexit__(self, exc_type: Any, exc: Any, tb: Any) -> bool | None: ...
1 change: 1 addition & 0 deletions boxd/errors.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
class NotFoundError(Exception): ...
4 changes: 2 additions & 2 deletions tests/unit/runtime/test_boxd_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ async def test_stream_logs_tails_agent_log(mock_boxd, fake_box, boxd_api_key):

assert out == chunks
call = fake_box.exec.await_args
assert call is not None
assert call is not None, "await_args should not be None"
assert call.args[0] == "tail"
assert "-F" in call.args
assert AGENT_LOG_PATH in call.args
Expand All @@ -780,7 +780,7 @@ async def test_stream_logs_no_follow_uses_cat(mock_boxd, fake_box, boxd_api_key)
out = [chunk async for chunk in p.stream_logs(h, follow=False)]
assert out == [b"static\n"]
call = fake_box.exec.await_args
assert call is not None
assert call is not None, "await_args should not be None"
# Either tail-without-F or cat with a no-error wrapper is fine; check that
# the streamed command does NOT contain ``-F`` (which would tail forever).
assert "-F" not in call.args
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/runtime/test_cli_shell_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def __anext__(self):
assert "hello" in out
assert "world" in out
call = fake_box.exec.await_args
assert call is not None
assert call is not None, "await_args should not be None"
assert call.kwargs.get("stream") is True
assert "-F" in call.args # follow=True → tail -F

Expand All @@ -70,6 +70,6 @@ async def test_shell_calls_exec_bash():

fake_box.exec.assert_awaited_once()
args = fake_box.exec.await_args
assert args is not None
assert args is not None, "await_args should not be None"
assert "bash" in args.args
assert args.kwargs.get("interactive") is True
Loading