Skip to content

Commit e9350d2

Browse files
release: 1.6.0 (#146)
* chore(docs): remove reference to rye shell * chore(docs): remove unnecessary param examples * feat(client): add follow_redirects request option * chore(tests): run tests in parallel * fix(client): correctly parse binary response | stream * chore(tests): add tests for httpx client instantiation & proxies * chore(internal): update conftest.py * chore(ci): enable for pull requests * feat(api): api update * chore(readme): update badges * fix(tests): fix: tests which call HTTP endpoints directly with the example parameters * release: 1.6.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 0918ad8 commit e9350d2

35 files changed

+3056
-99
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- 'integrated/**'
88
- 'stl-preview-head/**'
99
- 'stl-preview-base/**'
10+
pull_request:
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
1014

1115
jobs:
1216
lint:

.release-please-manifest.json

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

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 19
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-8c15fa101ceb4bf0f446fce918d2092361770e32ce43e6f88e1ece57244e8fa6.yml
3-
openapi_spec_hash: 008132037e04c877822a61f59c789647
4-
config_hash: 214997e49eded7cde9997ecb3bb24f68
1+
configured_endpoints: 28
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-51958c25f4f5f8d03d873744f15369a2ce2894f246f162aecac70d1b4d2b6008.yml
3+
openapi_spec_hash: 5f61d1691a2c83c8067bc837b0000237
4+
config_hash: 6eb072febff9e7aba9cdeb6901761b97

CHANGELOG.md

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

3+
## 1.6.0 (2025-06-18)
4+
5+
Full Changelog: [v1.5.0...v1.6.0](https://github.com/ArcadeAI/arcade-py/compare/v1.5.0...v1.6.0)
6+
7+
### Features
8+
9+
* **api:** api update ([cd6f884](https://github.com/ArcadeAI/arcade-py/commit/cd6f884df03a517ad7af92d229f0178e181f52e7))
10+
* **client:** add follow_redirects request option ([37071b8](https://github.com/ArcadeAI/arcade-py/commit/37071b84834f987c5c97bd31e42598d29079e670))
11+
12+
13+
### Bug Fixes
14+
15+
* **client:** correctly parse binary response | stream ([30b1399](https://github.com/ArcadeAI/arcade-py/commit/30b1399ae02f8190c79b330190f834291190f76c))
16+
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([f7d916c](https://github.com/ArcadeAI/arcade-py/commit/f7d916c9c4927adc62b438b1b71eec3a242e8f3d))
17+
18+
19+
### Chores
20+
21+
* **ci:** enable for pull requests ([181f08f](https://github.com/ArcadeAI/arcade-py/commit/181f08fa2a8bcef17a61dcefd0e4078b6f6357aa))
22+
* **docs:** remove reference to rye shell ([bb105b1](https://github.com/ArcadeAI/arcade-py/commit/bb105b130ee4f24fe8e4a8114b464ae9789ffcd8))
23+
* **docs:** remove unnecessary param examples ([e63f45b](https://github.com/ArcadeAI/arcade-py/commit/e63f45ba884856f91e7387ed73b87667557c8ef0))
24+
* **internal:** update conftest.py ([6f4b908](https://github.com/ArcadeAI/arcade-py/commit/6f4b908240825138aa4f97da939fd4b8cb965bad))
25+
* **readme:** update badges ([e0ecda6](https://github.com/ArcadeAI/arcade-py/commit/e0ecda6d97885630a77933dc7fdb57c2540c8a2d))
26+
* **tests:** add tests for httpx client instantiation & proxies ([8328a61](https://github.com/ArcadeAI/arcade-py/commit/8328a616e0f73562720bcdeee7532887ae328999))
27+
* **tests:** run tests in parallel ([aabdc37](https://github.com/ArcadeAI/arcade-py/commit/aabdc37b1979121dd756a6cc1dbe31145db3c9da))
28+
329
## 1.5.0 (2025-06-02)
430

531
Full Changelog: [v1.4.0...v1.5.0](https://github.com/ArcadeAI/arcade-py/compare/v1.4.0...v1.5.0)

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ $ rye sync --all-features
1717
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
1818

1919
```sh
20-
$ rye shell
21-
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
20+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
2221
$ source .venv/bin/activate
2322

2423
# now you can omit the `rye run` prefix

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Arcade Python API library
22

3-
[![PyPI version](https://img.shields.io/pypi/v/arcadepy.svg)](https://pypi.org/project/arcadepy/)
3+
[![PyPI version](<https://img.shields.io/pypi/v/arcadepy.svg?label=pypi%20(stable)>)](https://pypi.org/project/arcadepy/)
44

55
The Arcade Python library provides convenient access to the Arcade REST API from any Python 3.8+
66
application. The library includes type definitions for all request params and response fields,
@@ -91,7 +91,7 @@ from arcadepy import Arcade
9191
client = Arcade()
9292

9393
chat_response = client.chat.completions.create(
94-
response_format={"type": "json_object"},
94+
response_format={},
9595
)
9696
print(chat_response.response_format)
9797
```

api.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,55 @@
44
from arcadepy.types import AuthorizationContext, AuthorizationResponse, Error
55
```
66

7+
# Admin
8+
9+
## UserConnections
10+
11+
Types:
12+
13+
```python
14+
from arcadepy.types.admin import UserConnectionResponse
15+
```
16+
17+
Methods:
18+
19+
- <code title="get /v1/admin/user_connections">client.admin.user_connections.<a href="./src/arcadepy/resources/admin/user_connections.py">list</a>(\*\*<a href="src/arcadepy/types/admin/user_connection_list_params.py">params</a>) -> <a href="./src/arcadepy/types/admin/user_connection_response.py">SyncOffsetPage[UserConnectionResponse]</a></code>
20+
- <code title="delete /v1/admin/user_connections/{id}">client.admin.user_connections.<a href="./src/arcadepy/resources/admin/user_connections.py">delete</a>(id) -> None</code>
21+
22+
## AuthProviders
23+
24+
Types:
25+
26+
```python
27+
from arcadepy.types.admin import (
28+
AuthProviderCreateRequest,
29+
AuthProviderResponse,
30+
AuthProviderUpdateRequest,
31+
AuthProviderListResponse,
32+
)
33+
```
34+
35+
Methods:
36+
37+
- <code title="post /v1/admin/auth_providers">client.admin.auth_providers.<a href="./src/arcadepy/resources/admin/auth_providers.py">create</a>(\*\*<a href="src/arcadepy/types/admin/auth_provider_create_params.py">params</a>) -> <a href="./src/arcadepy/types/admin/auth_provider_response.py">AuthProviderResponse</a></code>
38+
- <code title="get /v1/admin/auth_providers">client.admin.auth_providers.<a href="./src/arcadepy/resources/admin/auth_providers.py">list</a>() -> <a href="./src/arcadepy/types/admin/auth_provider_list_response.py">AuthProviderListResponse</a></code>
39+
- <code title="delete /v1/admin/auth_providers/{id}">client.admin.auth_providers.<a href="./src/arcadepy/resources/admin/auth_providers.py">delete</a>(id) -> <a href="./src/arcadepy/types/admin/auth_provider_response.py">AuthProviderResponse</a></code>
40+
- <code title="get /v1/admin/auth_providers/{id}">client.admin.auth_providers.<a href="./src/arcadepy/resources/admin/auth_providers.py">get</a>(id) -> <a href="./src/arcadepy/types/admin/auth_provider_response.py">AuthProviderResponse</a></code>
41+
- <code title="patch /v1/admin/auth_providers/{id}">client.admin.auth_providers.<a href="./src/arcadepy/resources/admin/auth_providers.py">patch</a>(path_id, \*\*<a href="src/arcadepy/types/admin/auth_provider_patch_params.py">params</a>) -> <a href="./src/arcadepy/types/admin/auth_provider_response.py">AuthProviderResponse</a></code>
42+
43+
## Secrets
44+
45+
Types:
46+
47+
```python
48+
from arcadepy.types.admin import SecretResponse, SecretListResponse
49+
```
50+
51+
Methods:
52+
53+
- <code title="get /v1/admin/secrets">client.admin.secrets.<a href="./src/arcadepy/resources/admin/secrets.py">list</a>() -> <a href="./src/arcadepy/types/admin/secret_list_response.py">SecretListResponse</a></code>
54+
- <code title="delete /v1/admin/secrets/{secret_id}">client.admin.secrets.<a href="./src/arcadepy/resources/admin/secrets.py">delete</a>(secret_id) -> None</code>
55+
756
# Auth
857

958
Types:

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "arcadepy"
3-
version = "1.5.0"
3+
version = "1.6.0"
44
description = "The official Python library for the Arcade 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/ArcadeAI/arcade-py/tree/main/\g<2>)'
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/arcadepy/_base_client.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,9 @@ def request(
960960
if self.custom_auth is not None:
961961
kwargs["auth"] = self.custom_auth
962962

963+
if options.follow_redirects is not None:
964+
kwargs["follow_redirects"] = options.follow_redirects
965+
963966
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
964967

965968
response = None
@@ -1068,7 +1071,14 @@ def _process_response(
10681071
) -> ResponseT:
10691072
origin = get_origin(cast_to) or cast_to
10701073

1071-
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+
):
10721082
if not issubclass(origin, APIResponse):
10731083
raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}")
10741084

@@ -1460,6 +1470,9 @@ async def request(
14601470
if self.custom_auth is not None:
14611471
kwargs["auth"] = self.custom_auth
14621472

1473+
if options.follow_redirects is not None:
1474+
kwargs["follow_redirects"] = options.follow_redirects
1475+
14631476
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
14641477

14651478
response = None
@@ -1568,7 +1581,14 @@ async def _process_response(
15681581
) -> ResponseT:
15691582
origin = get_origin(cast_to) or cast_to
15701583

1571-
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+
):
15721592
if not issubclass(origin, AsyncAPIResponse):
15731593
raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}")
15741594

0 commit comments

Comments
 (0)