Skip to content

Commit 9b40fb9

Browse files
authored
Merge pull request #602 from runloopai/release-please--branches--main--changes--next
release: 0.43.0
2 parents dc3c27e + fe76d32 commit 9b40fb9

File tree

10 files changed

+62
-14
lines changed

10 files changed

+62
-14
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.42.0"
2+
".": "0.43.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 91
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86c4a065b1820b26c7afd40bbc374e87dd5e9c2ffa0abad26e7fd4ebec1cf72b.yml
3-
openapi_spec_hash: 6c6a44548177464033f3c174c89ba06a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-32aaecf1da425c37d534ed04df36003ab9d766a7755cd18f96541929a2a3ea59.yml
3+
openapi_spec_hash: e326c47b99943cbbab473fde3b257221
44
config_hash: 421e8d0e71c7ef71fdfebede08ea7271

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## 0.43.0 (2025-06-14)
4+
5+
Full Changelog: [v0.42.0...v0.43.0](https://github.com/runloopai/api-client-python/compare/v0.42.0...v0.43.0)
6+
7+
### Features
8+
9+
* **api:** api update ([695b29a](https://github.com/runloopai/api-client-python/commit/695b29a97bd2dcad3f90ee377ed0475a84ed1a2b))
10+
11+
12+
### Bug Fixes
13+
14+
* **client:** correctly parse binary response | stream ([1d815d4](https://github.com/runloopai/api-client-python/commit/1d815d468db24142174fe536c05dcd3ec49ee03f))
15+
16+
17+
### Chores
18+
19+
* **tests:** run tests in parallel ([fdeee42](https://github.com/runloopai/api-client-python/commit/fdeee42440c5df55af77cbad2423c7faab473dcd))
20+
321
## 0.42.0 (2025-06-11)
422

523
Full Changelog: [v0.41.0...v0.42.0](https://github.com/runloopai/api-client-python/compare/v0.41.0...v0.42.0)

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "runloop_api_client"
3-
version = "0.42.0"
3+
version = "0.43.0"
44
description = "The official Python library for the runloop API"
55
dynamic = ["readme"]
66
license = "MIT"
@@ -54,6 +54,7 @@ dev-dependencies = [
5454
"importlib-metadata>=6.7.0",
5555
"rich>=13.7.1",
5656
"nest_asyncio==1.6.0",
57+
"pytest-xdist>=3.6.1",
5758
]
5859

5960
[tool.rye.scripts]
@@ -125,7 +126,7 @@ replacement = '[\1](https://github.com/runloopai/api-client-python/tree/main/\g<
125126

126127
[tool.pytest.ini_options]
127128
testpaths = ["tests"]
128-
addopts = "--tb=short"
129+
addopts = "--tb=short -n auto"
129130
xfail_strict = true
130131
asyncio_mode = "auto"
131132
asyncio_default_fixture_loop_scope = "session"

requirements-dev.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ distro==1.8.0
3030
exceptiongroup==1.2.2
3131
# via anyio
3232
# via pytest
33+
execnet==2.1.1
34+
# via pytest-xdist
3335
filelock==3.12.4
3436
# via virtualenv
3537
h11==0.14.0
@@ -72,7 +74,9 @@ pygments==2.18.0
7274
pyright==1.1.399
7375
pytest==8.3.3
7476
# via pytest-asyncio
77+
# via pytest-xdist
7578
pytest-asyncio==0.24.0
79+
pytest-xdist==3.7.0
7680
python-dateutil==2.8.2
7781
# via time-machine
7882
pytz==2023.3.post1

src/runloop_api_client/_base_client.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,14 @@ def _process_response(
10711071
) -> ResponseT:
10721072
origin = get_origin(cast_to) or cast_to
10731073

1074-
if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1074+
if (
1075+
inspect.isclass(origin)
1076+
and issubclass(origin, BaseAPIResponse)
1077+
# we only want to actually return the custom BaseAPIResponse class if we're
1078+
# returning the raw response, or if we're not streaming SSE, as if we're streaming
1079+
# SSE then `cast_to` doesn't actively reflect the type we need to parse into
1080+
and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1081+
):
10751082
if not issubclass(origin, APIResponse):
10761083
raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}")
10771084

@@ -1574,7 +1581,14 @@ async def _process_response(
15741581
) -> ResponseT:
15751582
origin = get_origin(cast_to) or cast_to
15761583

1577-
if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1584+
if (
1585+
inspect.isclass(origin)
1586+
and issubclass(origin, BaseAPIResponse)
1587+
# we only want to actually return the custom BaseAPIResponse class if we're
1588+
# returning the raw response, or if we're not streaming SSE, as if we're streaming
1589+
# SSE then `cast_to` doesn't actively reflect the type we need to parse into
1590+
and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1591+
):
15781592
if not issubclass(origin, AsyncAPIResponse):
15791593
raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}")
15801594

src/runloop_api_client/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "runloop_api_client"
4-
__version__ = "0.42.0" # x-release-please-version
4+
__version__ = "0.43.0" # x-release-please-version

src/runloop_api_client/resources/scenarios/scenarios.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ def update(
256256
def list(
257257
self,
258258
*,
259+
benchmark_id: str | NotGiven = NOT_GIVEN,
259260
limit: int | NotGiven = NOT_GIVEN,
260261
name: str | NotGiven = NOT_GIVEN,
261262
starting_after: str | NotGiven = NOT_GIVEN,
@@ -266,12 +267,13 @@ def list(
266267
extra_body: Body | None = None,
267268
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
268269
) -> SyncScenariosCursorIDPage[ScenarioView]:
269-
"""List all Scenarios matching filter.
270+
"""
271+
List all Scenarios matching filter.
270272
271273
Args:
272-
limit: The limit of items to return.
274+
benchmark_id: Filter scenarios by benchmark ID.
273275
274-
Default is 20.
276+
limit: The limit of items to return. Default is 20.
275277
276278
name: Query for Scenarios with a given name.
277279
@@ -295,6 +297,7 @@ def list(
295297
timeout=timeout,
296298
query=maybe_transform(
297299
{
300+
"benchmark_id": benchmark_id,
298301
"limit": limit,
299302
"name": name,
300303
"starting_after": starting_after,
@@ -679,6 +682,7 @@ async def update(
679682
def list(
680683
self,
681684
*,
685+
benchmark_id: str | NotGiven = NOT_GIVEN,
682686
limit: int | NotGiven = NOT_GIVEN,
683687
name: str | NotGiven = NOT_GIVEN,
684688
starting_after: str | NotGiven = NOT_GIVEN,
@@ -689,12 +693,13 @@ def list(
689693
extra_body: Body | None = None,
690694
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
691695
) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]:
692-
"""List all Scenarios matching filter.
696+
"""
697+
List all Scenarios matching filter.
693698
694699
Args:
695-
limit: The limit of items to return.
700+
benchmark_id: Filter scenarios by benchmark ID.
696701
697-
Default is 20.
702+
limit: The limit of items to return. Default is 20.
698703
699704
name: Query for Scenarios with a given name.
700705
@@ -718,6 +723,7 @@ def list(
718723
timeout=timeout,
719724
query=maybe_transform(
720725
{
726+
"benchmark_id": benchmark_id,
721727
"limit": limit,
722728
"name": name,
723729
"starting_after": starting_after,

src/runloop_api_client/types/scenario_list_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99

1010
class ScenarioListParams(TypedDict, total=False):
11+
benchmark_id: str
12+
"""Filter scenarios by benchmark ID."""
13+
1114
limit: int
1215
"""The limit of items to return. Default is 20."""
1316

tests/api_resources/test_scenarios.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def test_method_list(self, client: Runloop) -> None:
339339
@parametrize
340340
def test_method_list_with_all_params(self, client: Runloop) -> None:
341341
scenario = client.scenarios.list(
342+
benchmark_id="benchmark_id",
342343
limit=0,
343344
name="name",
344345
starting_after="starting_after",
@@ -762,6 +763,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None:
762763
@parametrize
763764
async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None:
764765
scenario = await async_client.scenarios.list(
766+
benchmark_id="benchmark_id",
765767
limit=0,
766768
name="name",
767769
starting_after="starting_after",

0 commit comments

Comments
 (0)