Skip to content

Commit b50f80e

Browse files
committed
Merge branch 'main' into james/ctxt-loader
2 parents deeea33 + be047f6 commit b50f80e

28 files changed

+1920
-22
lines changed

CONTRIBUTING.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,49 @@ Most tests require you to [set up a mock server](https://github.com/stoplightio/
8989

9090
```sh
9191
# you will need npm installed
92-
$ npx prism mock path/to/your/openapi.yml
92+
npx prism mock path/to/your/openapi.yml
9393
```
9494

9595
```sh
96-
$ ./scripts/test
96+
# run all tests
97+
./scripts/test
98+
99+
# pass in pytest args, eg to show info on skipped tests:
100+
./scripts/test -rs
101+
102+
# Run tests for only one python version
103+
UV_PYTHON=3.13 ./scripts/test
104+
```
105+
106+
### Running pytets
107+
108+
Assuming you have a uv virtual env set up in .venv, the following are helpful for more granular test running:
109+
110+
```sh
111+
# Run all tests pytests
112+
.venv/bin/pytest tests/
113+
114+
# Run all SDK tests with verbose info
115+
.venv/bin/pytest tests/sdk/ -v
116+
117+
# Run specific test class
118+
.venv/bin/pytest tests/sdk/test_clients.py::TestAgentClient -v
119+
120+
# Run specific test method
121+
.venv/bin/pytest tests/sdk/test_clients.py::TestAgentClient::test_create_from_npm -v
122+
123+
# Run agent smoketests (requires RUNLOOP_API_KEY)
124+
export RUNLOOP_API_KEY=your_key_here
125+
.venv/bin/pytest tests/smoketests/sdk/test_agent.py -v
126+
127+
# Run tests matching a pattern
128+
.venv/bin/pytest tests/sdk/ -k "agent" -v
129+
130+
# Run with coverage
131+
.venv/bin/pytest tests/sdk/ --cov=src/runloop_api_client/sdk --cov-report=html
97132
```
98133

134+
99135
## Linting and formatting
100136

101137
This repository uses [ruff](https://github.com/astral-sh/ruff) and

docs/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Minimal makefile for Sphinx documentation
22
#
3+
# To rebuild the html docs, first make sure you've got the right deps installed via
4+
# uv sync --group docs
5+
# then from the docs directory (this dir) rebuild with
6+
# uv run make html
7+
# Look for generated docs under _build/html.
8+
39

410
# You can set these variables from the command line, and also
511
# from the environment for the first two.

docs/conf.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,25 @@
3535
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3636

3737
html_theme = "furo"
38-
html_static_path = ["_static"]
38+
# html_static_path = ["_static"]
39+
40+
# Furo theme options
41+
html_theme_options = {
42+
"navigation_with_keys": True,
43+
"sidebar_hide_name": False,
44+
}
45+
46+
# Show the global toctree in sidebar
47+
html_sidebars = {
48+
"**": [
49+
"sidebar/scroll-start.html",
50+
"sidebar/brand.html",
51+
"sidebar/search.html",
52+
"sidebar/navigation.html",
53+
"sidebar/ethical-ads.html",
54+
"sidebar/scroll-end.html",
55+
]
56+
}
3957

4058
# -- Extension configuration -------------------------------------------------
4159

docs/sdk/async/agent.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Agent
2+
======
3+
4+
The ``AsyncAgent`` class provides asynchronous methods for managing and interacting with stored Agents.
5+
6+
.. automodule:: runloop_api_client.sdk.async_agent
7+
:members:

docs/sdk/async/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ Asynchronous resource classes for working with devboxes, blueprints, snapshots,
2727
snapshot
2828
storage_object
2929
scorer
30-
30+
agent

docs/sdk/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ The Runloop SDK provides both synchronous and asynchronous interfaces for managi
99
:maxdepth: 2
1010
:caption: SDK Documentation
1111

12-
sync/index
1312
async/index
13+
sync/index
1414
types

docs/sdk/sync/agent.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Agent
2+
======
3+
4+
The ``Agent`` class provides synchronous methods for managing and interacting with stored Agents.
5+
6+
.. automodule:: runloop_api_client.sdk.agent
7+
:members:

docs/sdk/sync/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ Synchronous resource classes for working with devboxes, blueprints, snapshots, a
2727
snapshot
2828
storage_object
2929
scorer
30+
agent
3031

scripts/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
cd "$(dirname "$0")/.."
66

77
echo "==> Running lints"
8-
uv run ruff check .
8+
uv run ruff check . "$@"
99

1010
echo "==> Making sure it imports"
1111
uv run python -c 'import runloop_api_client'

src/runloop_api_client/sdk/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
from __future__ import annotations
77

8-
from .sync import DevboxOps, ScorerOps, RunloopSDK, SnapshotOps, BlueprintOps, StorageObjectOps
8+
from .sync import AgentOps, DevboxOps, ScorerOps, RunloopSDK, SnapshotOps, BlueprintOps, StorageObjectOps
9+
from .agent import Agent
910
from .async_ import (
11+
AsyncAgentOps,
1012
AsyncDevboxOps,
1113
AsyncScorerOps,
1214
AsyncRunloopSDK,
@@ -19,6 +21,7 @@
1921
from .snapshot import Snapshot
2022
from .blueprint import Blueprint
2123
from .execution import Execution
24+
from .async_agent import AsyncAgent
2225
from .async_devbox import AsyncDevbox, AsyncNamedShell
2326
from .async_scorer import AsyncScorer
2427
from .async_snapshot import AsyncSnapshot
@@ -34,6 +37,8 @@
3437
"RunloopSDK",
3538
"AsyncRunloopSDK",
3639
# Management interfaces
40+
"AgentOps",
41+
"AsyncAgentOps",
3742
"DevboxOps",
3843
"AsyncDevboxOps",
3944
"BlueprintOps",
@@ -45,6 +50,8 @@
4550
"StorageObjectOps",
4651
"AsyncStorageObjectOps",
4752
# Resource classes
53+
"Agent",
54+
"AsyncAgent",
4855
"Devbox",
4956
"AsyncDevbox",
5057
"Execution",

0 commit comments

Comments
 (0)