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
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install uv
uses: runloopai/setup-uv@main
with:
version: '0.8.11'
version: '0.9.13'

- name: Publish to PyPI
run: |
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.1.0"
".": "1.2.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cb2d725f71e87810cd872eacd70e867ca10f94980fdf9c78bb2844c02ee47bf3.yml
openapi_spec_hash: 16ce3e9184fc2afdee66db18a83a96e8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f2df3524e4b99c38b634c334d098aa2c7d543d5ea0f49c4dd8f4d92723b81b94.yml
openapi_spec_hash: c377abec5716d1d6c5b01a527a5bfdfb
config_hash: 2363f563f42501d2b1587a4f64bdccaf
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## 1.2.0 (2025-12-09)

Full Changelog: [v1.1.0...v1.2.0](https://github.com/runloopai/api-client-python/compare/v1.1.0...v1.2.0)

### Features

* **devbox:** default to x86 arch ([501de0b](https://github.com/runloopai/api-client-python/commit/501de0bb1d76c836ff9f448513a16155641345ae))
* **devbox:** return user for createSshKey ([f094bf7](https://github.com/runloopai/api-client-python/commit/f094bf7443a0ca5bab6d47a53b7b14bade3cecd0))


### Bug Fixes

* ensure streams are always closed ([d01aae2](https://github.com/runloopai/api-client-python/commit/d01aae204d8c57ac76646df0e0e1078e64ad9891))


### Chores

* bump required `uv` version ([8ad519f](https://github.com/runloopai/api-client-python/commit/8ad519fd26d389628d157a413a0b0f1f5d435e9e))
* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([e56582a](https://github.com/runloopai/api-client-python/commit/e56582a93590445d8e545b6123be0f14db39a8f5))
* **docs:** use environment variables for authentication in code snippets ([55cf613](https://github.com/runloopai/api-client-python/commit/55cf6131edb8d38144761c5dbbbcf9389093ed7b))
* **internal:** version bump ([2fa85c6](https://github.com/runloopai/api-client-python/commit/2fa85c6694dc468280eedb28136aadcda4f11801))
* remove some unnecessary changes to reduce diff from Stainless ([#705](https://github.com/runloopai/api-client-python/issues/705)) ([715c9d0](https://github.com/runloopai/api-client-python/commit/715c9d09f4e874032ee1d4d6c81d80ab6a72ec45))
* update lockfile ([7e0136d](https://github.com/runloopai/api-client-python/commit/7e0136dfcd62a2843138ae382bd6fedfd881e1b3))
* update requirements-dev.lock ([#707](https://github.com/runloopai/api-client-python/issues/707)) ([a2d5326](https://github.com/runloopai/api-client-python/commit/a2d5326634cad5afe6c74252d26b01916ed41bcb))
* update uv.lock ([b9e0729](https://github.com/runloopai/api-client-python/commit/b9e07291745291d16f122dbca5ef513ed134c5dd))

## 1.1.0 (2025-12-06)

Full Changelog: [v1.0.0...v1.1.0](https://github.com/runloopai/api-client-python/compare/v1.0.0...v1.1.0)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ pip install runloop_api_client[aiohttp]
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from runloop_api_client import DefaultAioHttpClient
from runloop_api_client import AsyncRunloop


async def main() -> None:
async with AsyncRunloop(
bearer_token="My Bearer Token",
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
devbox_view = await client.devboxes.create()
Expand Down
2 changes: 0 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
```python
from runloop_api_client.types import (
AfterIdle,
AgentMountParameters,
AgentSource,
CodeMountParameters,
LaunchParameters,
Mount,
ObjectMountParameters,
RunProfile,
)
```
Expand Down
18 changes: 10 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
[project]
name = "runloop_api_client"
version = "1.1.0"
version = "1.2.0"
description = "The official Python library for the runloop API"
dynamic = ["readme"]
license = "MIT"
authors = [
{ name = "Runloop", email = "support@runloop.ai" },
]

dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"uuid-utils>=0.11.0",
]

requires-python = ">= 3.9"
classifiers = [
"Typing :: Typed",
Expand Down Expand Up @@ -56,7 +58,7 @@ conflicts = [
# version pins are in uv.lock
dev = [
"pyright==1.1.399",
"mypy",
"mypy==1.17",
"respx",
"pytest",
"pytest-asyncio",
Expand Down
27 changes: 5 additions & 22 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ certifi==2025.11.12
# httpx
colorama==0.4.6 ; sys_platform == 'win32'
# via pytest
coverage==7.10.7 ; python_full_version < '3.10'
# via pytest-cov
coverage==7.13.0 ; python_full_version >= '3.10'
# via pytest-cov
dirty-equals==0.11
distro==1.9.0
# via runloop-api-client
Expand All @@ -45,15 +41,13 @@ iniconfig==2.1.0 ; python_full_version < '3.10'
# via pytest
iniconfig==2.3.0 ; python_full_version >= '3.10'
# via pytest
librt==0.7.3
# via mypy
markdown-it-py==3.0.0 ; python_full_version < '3.10'
# via rich
markdown-it-py==4.0.0 ; python_full_version >= '3.10'
# via rich
mdurl==0.1.2
# via markdown-it-py
mypy==1.19.0
mypy==1.17.0
mypy-extensions==1.1.0
# via mypy
nodeenv==1.9.1
Expand All @@ -63,9 +57,7 @@ packaging==25.0
pathspec==0.12.1
# via mypy
pluggy==1.6.0
# via
# pytest
# pytest-cov
# via pytest
pydantic==2.12.5
# via runloop-api-client
pydantic-core==2.41.5
Expand All @@ -78,34 +70,27 @@ pyright==1.1.399
pytest==8.4.2 ; python_full_version < '3.10'
# via
# pytest-asyncio
# pytest-cov
# pytest-timeout
# pytest-xdist
pytest==9.0.2 ; python_full_version >= '3.10'
pytest==9.0.1 ; python_full_version >= '3.10'
# via
# pytest-asyncio
# pytest-cov
# pytest-timeout
# pytest-xdist
pytest-asyncio==1.2.0 ; python_full_version < '3.10'
pytest-asyncio==1.3.0 ; python_full_version >= '3.10'
pytest-cov==7.0.0
pytest-timeout==2.4.0
pytest-xdist==3.8.0
python-dateutil==2.9.0.post0 ; python_full_version < '3.10'
# via time-machine
respx==0.22.0
rich==14.2.0
ruff==0.14.8
ruff==0.14.7
six==1.17.0 ; python_full_version < '3.10'
# via python-dateutil
sniffio==1.3.1
# via runloop-api-client
time-machine==2.19.0 ; python_full_version < '3.10'
time-machine==3.1.0 ; python_full_version >= '3.10'
tomli==2.3.0 ; python_full_version <= '3.11'
tomli==2.3.0 ; python_full_version < '3.11'
# via
# coverage
# mypy
# pytest
typing-extensions==4.15.0
Expand All @@ -121,7 +106,5 @@ typing-extensions==4.15.0
# typing-inspection
typing-inspection==0.4.2
# via pydantic
uuid-utils==0.12.0
# via runloop-api-client
zipp==3.23.0
# via importlib-metadata
64 changes: 32 additions & 32 deletions src/runloop_api_client/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@ def __stream__(self) -> Iterator[_T]:
process_data = self._client._process_response_data
iterator = self._iter_events()

for sse in iterator:
# Surface server-sent error events as API errors to allow callers to handle/retry
if sse.event == "error":
try:
error_obj = json.loads(sse.data)
status_code = int(error_obj.get("code", 500))
# Build a synthetic response to mirror normal error handling
fake_resp = httpx.Response(status_code, request=response.request, content=sse.data)
except Exception:
fake_resp = httpx.Response(500, request=response.request, content=sse.data)
raise self._client._make_status_error_from_response(fake_resp)

yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# As we might not fully consume the response stream, we need to close it explicitly
response.close()
try:
for sse in iterator:
# Surface server-sent error events as API errors to allow callers to handle/retry
if sse.event == "error":
try:
error_obj = json.loads(sse.data)
status_code = int(error_obj.get("code", 500))
fake_resp = httpx.Response(status_code, request=response.request, content=sse.data)
except Exception:
fake_resp = httpx.Response(500, request=response.request, content=sse.data)
raise self._client._make_status_error_from_response(fake_resp)

yield process_data(data=sse.json(), cast_to=cast_to, response=response)
finally:
# Ensure the response is closed even if the consumer doesn't read all data
response.close()

def __enter__(self) -> Self:
return self
Expand Down Expand Up @@ -147,22 +147,22 @@ async def __stream__(self) -> AsyncIterator[_T]:
process_data = self._client._process_response_data
iterator = self._iter_events()

async for sse in iterator:
# Surface server-sent error events as API errors to allow callers to handle/retry
if sse.event == "error":
try:
error_obj = json.loads(sse.data)
status_code = int(error_obj.get("code", 500))
# Build a synthetic response to mirror normal error handling
fake_resp = httpx.Response(status_code, request=response.request, content=sse.data)
except Exception:
fake_resp = httpx.Response(500, request=response.request, content=sse.data)
raise self._client._make_status_error_from_response(fake_resp)

yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# As we might not fully consume the response stream, we need to close it explicitly
await response.aclose()
try:
async for sse in iterator:
# Surface server-sent error events as API errors to allow callers to handle/retry
if sse.event == "error":
try:
error_obj = json.loads(sse.data)
status_code = int(error_obj.get("code", 500))
fake_resp = httpx.Response(status_code, request=response.request, content=sse.data)
except Exception:
fake_resp = httpx.Response(500, request=response.request, content=sse.data)
raise self._client._make_status_error_from_response(fake_resp)

yield process_data(data=sse.json(), cast_to=cast_to, response=response)
finally:
# Ensure the response is closed even if the consumer doesn't read all data
await response.aclose()

async def __aenter__(self) -> Self:
return self
Expand Down
2 changes: 1 addition & 1 deletion src/runloop_api_client/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "runloop_api_client"
__version__ = "1.1.0" # x-release-please-version
__version__ = "1.2.0" # x-release-please-version
2 changes: 0 additions & 2 deletions src/runloop_api_client/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
AgentSource as AgentSource,
LaunchParameters as LaunchParameters,
CodeMountParameters as CodeMountParameters,
AgentMountParameters as AgentMountParameters,
ObjectMountParameters as ObjectMountParameters,
)
from .agent_view import AgentView as AgentView
from .devbox_view import DevboxView as DevboxView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ class DevboxCreateSSHKeyResponse(BaseModel):
ssh_private_key: str
"""The ssh private key, in PEM format."""

ssh_user: str
"""The Linux user to use for SSH connections to this Devbox."""

url: str
"""The host url of the Devbox that can be used for SSH."""
2 changes: 0 additions & 2 deletions src/runloop_api_client/types/shared/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@
from .agent_source import AgentSource as AgentSource
from .launch_parameters import LaunchParameters as LaunchParameters
from .code_mount_parameters import CodeMountParameters as CodeMountParameters
from .agent_mount_parameters import AgentMountParameters as AgentMountParameters
from .object_mount_parameters import ObjectMountParameters as ObjectMountParameters
31 changes: 0 additions & 31 deletions src/runloop_api_client/types/shared/agent_mount_parameters.py

This file was deleted.

3 changes: 0 additions & 3 deletions src/runloop_api_client/types/shared/code_mount_parameters.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from ..._models import BaseModel

Expand All @@ -18,8 +17,6 @@ class CodeMountParameters(BaseModel):
repo_owner: str
"""The owner of the repo."""

type: Literal["code_mount"]

token: Optional[str] = None
"""The authentication token necessary to pull repo."""

Expand Down
2 changes: 1 addition & 1 deletion src/runloop_api_client/types/shared/launch_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LaunchParameters(BaseModel):
"""

architecture: Optional[Literal["x86_64", "arm64"]] = None
"""The target architecture for the Devbox. If unset, defaults to arm64."""
"""The target architecture for the Devbox. If unset, defaults to x86_64."""

available_ports: Optional[List[int]] = None
"""A list of ports to make available on the Devbox.
Expand Down
Loading