Skip to content
Merged
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
5 changes: 2 additions & 3 deletions src/runloop_api_client/sdk/async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,16 @@ class AsyncBlueprintOps:
... dockerfile="FROM ubuntu:22.04\\nRUN apt-get update",
... )
>>> blueprints = await runloop.blueprint.list()

To use a local directory as a build context, use an object.

Example:
>>> from datetime import timedelta
>>> from runloop_api_client.types.blueprint_build_parameters import BuildContext
>>>
>>> runloop = AsyncRunloopSDK()
>>> obj = await runloop.object_storage.upload_from_dir(
... "./",
... ttl=timedelta(hours=1),
... ttl=timedelta(hours=1),
... )
>>> blueprint = await runloop.blueprint.create(
... name="my-blueprint",
Expand Down
2 changes: 0 additions & 2 deletions src/runloop_api_client/sdk/async_devbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,6 @@ async def exec(
>>> result = await shell.exec("npm install", stdout=lambda line: print(f"[LOG] {line}"))
"""
# Ensure shell_name is set and cannot be overridden by user params
params = dict(params)
params["shell_name"] = self._shell_name
return await self._devbox.cmd.exec(command, **params)

Expand Down Expand Up @@ -677,7 +676,6 @@ async def exec_async(
... print("Task completed successfully!")
"""
# Ensure shell_name is set and cannot be overridden by user params
params = dict(params)
params["shell_name"] = self._shell_name
return await self._devbox.cmd.exec_async(command, **params)

Expand Down
2 changes: 0 additions & 2 deletions src/runloop_api_client/sdk/devbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ def exec(
>>> result = shell.exec("npm install", stdout=lambda line: print(f"[LOG] {line}"))
"""
# Ensure shell_name is set and cannot be overridden by user params
params = dict(params)
params["shell_name"] = self._shell_name
return self._devbox.cmd.exec(command, **params)

Expand Down Expand Up @@ -685,7 +684,6 @@ def exec_async(
... print("Task completed successfully!")
"""
# Ensure shell_name is set and cannot be overridden by user params
params = dict(params)
params["shell_name"] = self._shell_name
return self._devbox.cmd.exec_async(command, **params)

Expand Down
3 changes: 1 addition & 2 deletions src/runloop_api_client/sdk/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,10 @@ class BlueprintOps:
Example:
>>> from datetime import timedelta
>>> from runloop_api_client.types.blueprint_build_parameters import BuildContext
>>>
>>> runloop = RunloopSDK()
>>> obj = runloop.object_storage.upload_from_dir(
... "./",
... ttl=timedelta(hours=1),
... ttl=timedelta(hours=1),
... )
>>> blueprint = runloop.blueprint.create(
... name="my-blueprint",
Expand Down
28 changes: 0 additions & 28 deletions tests/smoketests/sdk/test_async_devbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,34 +930,6 @@ async def test_shell_auto_generated_name(self, devbox: AsyncDevbox) -> None:
output = await result.stdout()
assert "test" in output

@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
async def test_shell_exec_with_additional_params(self, devbox: AsyncDevbox) -> None:
"""Test that additional params are passed through correctly."""
shell = devbox.shell("test-shell-params")

# Test that additional params (like working_dir) are passed through correctly
# Note: shell_name should override any shell_name in params
result = await shell.exec("pwd", working_dir="/tmp")

assert result.exit_code == 0
output = (await result.stdout()).strip()
# Should be in /tmp due to working_dir param
assert output == "/tmp"

@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
async def test_shell_exec_async_with_additional_params(self, devbox: AsyncDevbox) -> None:
"""Test that additional params are passed through correctly in exec_async."""
shell = devbox.shell("test-shell-async-params")

# Test that additional params are passed through correctly
execution = await shell.exec_async("pwd", working_dir="/home")

result = await execution.result()
assert result.exit_code == 0
output = (await result.stdout()).strip()
# Should be in /home due to working_dir param
assert output == "/home"

@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
async def test_shell_exec_with_stderr_streaming(self, devbox: AsyncDevbox) -> None:
"""Test shell exec with stderr streaming callback."""
Expand Down
3 changes: 2 additions & 1 deletion tests/smoketests/sdk/test_async_storage_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

THIRTY_SECOND_TIMEOUT = 30
TWO_MINUTE_TIMEOUT = 120
FOUR_MINUTE_TIMEOUT = 240


class TestAsyncStorageObjectLifecycle:
Expand Down Expand Up @@ -464,7 +465,7 @@ async def test_complete_upload_download_workflow(self, async_sdk_client: AsyncRu
# Delete
await obj.delete()

@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
@pytest.mark.timeout(FOUR_MINUTE_TIMEOUT)
async def test_storage_object_in_devbox_workflow(self, async_sdk_client: AsyncRunloopSDK) -> None:
"""Test workflow: create storage object, write from devbox, download."""
# Create empty storage object
Expand Down
28 changes: 0 additions & 28 deletions tests/smoketests/sdk/test_devbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,34 +918,6 @@ def test_shell_auto_generated_name(self, devbox: Devbox) -> None:
output = result.stdout()
assert "test" in output

@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
def test_shell_exec_with_additional_params(self, devbox: Devbox) -> None:
"""Test that additional params are passed through correctly."""
shell = devbox.shell("test-shell-params")

# Test that additional params (like working_dir) are passed through correctly
# Note: shell_name should override any shell_name in params
result = shell.exec("pwd", working_dir="/tmp")

assert result.exit_code == 0
output = result.stdout().strip()
# Should be in /tmp due to working_dir param
assert output == "/tmp"

@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
def test_shell_exec_async_with_additional_params(self, devbox: Devbox) -> None:
"""Test that additional params are passed through correctly in exec_async."""
shell = devbox.shell("test-shell-async-params")

# Test that additional params are passed through correctly
execution = shell.exec_async("pwd", working_dir="/home")

result = execution.result()
assert result.exit_code == 0
output = result.stdout().strip()
# Should be in /home due to working_dir param
assert output == "/home"

@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
def test_shell_exec_with_stderr_streaming(self, devbox: Devbox) -> None:
"""Test shell exec with stderr streaming callback."""
Expand Down