Skip to content

Commit ca34d1b

Browse files
release: 0.12.0 (#160)
* chore(internal): avoid errors for isinstance checks on proxies * fix(package): support direct resource imports * chore(ci): upload sdks to package manager * chore(ci): fix installation instructions * chore(docs): grammar improvements * chore(docs): remove reference to rye shell * chore(docs): remove unnecessary param examples * feat(client): add follow_redirects request option * feat(api): api update * chore(tests): run tests in parallel * fix(client): correctly parse binary response | stream * codegen metadata * codegen metadata * chore(tests): add tests for httpx client instantiation & proxies * chore(internal): update conftest.py * chore(ci): enable for pull requests * codegen metadata * codegen metadata * chore(readme): update badges * fix(tests): fix: tests which call HTTP endpoints directly with the example parameters * docs(client): fix httpx.Timeout documentation reference * feat(client): add support for aiohttp * chore(tests): skip some failing tests on the latest python versions * feat(api): api update * feat(api): api update * feat(api): api update * release: 0.12.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent b0ea2ea commit ca34d1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1685
-100
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ 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:
1317
timeout-minutes: 10
1418
name: lint
1519
runs-on: ${{ github.repository == 'stainless-sdks/riza-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
1621
steps:
1722
- uses: actions/checkout@v4
1823

@@ -30,10 +35,35 @@ jobs:
3035
- name: Run lints
3136
run: ./scripts/lint
3237

38+
upload:
39+
if: github.repository == 'stainless-sdks/riza-api-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
40+
timeout-minutes: 10
41+
name: upload
42+
permissions:
43+
contents: read
44+
id-token: write
45+
runs-on: depot-ubuntu-24.04
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Get GitHub OIDC Token
50+
id: github-oidc
51+
uses: actions/github-script@v6
52+
with:
53+
script: core.setOutput('github_token', await core.getIDToken());
54+
55+
- name: Upload tarball
56+
env:
57+
URL: https://pkg.stainless.com/s
58+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
59+
SHA: ${{ github.sha }}
60+
run: ./scripts/utils/upload-artifact.sh
61+
3362
test:
3463
timeout-minutes: 10
3564
name: test
3665
runs-on: ${{ github.repository == 'stainless-sdks/riza-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
66+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
3767
steps:
3868
- uses: actions/checkout@v4
3969

.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.11.0"
2+
".": "0.12.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: 15
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-f9777846c474c861e6c31174f8f08fd46a68a896609c8841b924d4ba4cb6979b.yml
3-
openapi_spec_hash: 65364a3f3566c609aaed0b5c69600540
4-
config_hash: 8ac0e6ef0ce0f5388eed4f14e515a7c9
1+
configured_endpoints: 18
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-bab65e0b0c2b228ee407ddd78cdcd7f3708bac6d00c0ada71efc6eef73de20fe.yml
3+
openapi_spec_hash: 08c3a26bba78a202f09b51c2d4eb0001
4+
config_hash: cba1727a13fc23eaeb011480ac88a06d

CHANGELOG.md

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

3+
## 0.12.0 (2025-06-29)
4+
5+
Full Changelog: [v0.11.0...v0.12.0](https://github.com/riza-io/riza-api-python/compare/v0.11.0...v0.12.0)
6+
7+
### Features
8+
9+
* **api:** api update ([345e02a](https://github.com/riza-io/riza-api-python/commit/345e02a9e93c2ca9a26ce0f884dc9a018cd495cd))
10+
* **api:** api update ([54b8081](https://github.com/riza-io/riza-api-python/commit/54b808196ab410711a60e1e6eafc809045255580))
11+
* **api:** api update ([ab3a1f5](https://github.com/riza-io/riza-api-python/commit/ab3a1f5a2597a2407a96124c5bbd620eb61aed1a))
12+
* **api:** api update ([333d168](https://github.com/riza-io/riza-api-python/commit/333d1682a5d6f11000efba046a7874a156a6b4da))
13+
* **client:** add follow_redirects request option ([729c66e](https://github.com/riza-io/riza-api-python/commit/729c66e844308a7a56c4a7c56ce5af42f4abed0d))
14+
* **client:** add support for aiohttp ([b433926](https://github.com/riza-io/riza-api-python/commit/b433926d78e66e1234125f155aa6f2458be768ea))
15+
16+
17+
### Bug Fixes
18+
19+
* **client:** correctly parse binary response | stream ([2b6e46f](https://github.com/riza-io/riza-api-python/commit/2b6e46ffc653e27831681d2a6e3719f6f2e79d4d))
20+
* **package:** support direct resource imports ([5a8f2bd](https://github.com/riza-io/riza-api-python/commit/5a8f2bd588ed788643b59c1f64bf88af21f8774e))
21+
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([4ebdf17](https://github.com/riza-io/riza-api-python/commit/4ebdf17f9eba4d440261e307da12be148e4ab8c8))
22+
23+
24+
### Chores
25+
26+
* **ci:** enable for pull requests ([ce5b546](https://github.com/riza-io/riza-api-python/commit/ce5b546ced715900bff3f6d5a965ff482c20d46c))
27+
* **ci:** fix installation instructions ([dbfcc81](https://github.com/riza-io/riza-api-python/commit/dbfcc815e5022d343677c8eae511024949838c37))
28+
* **ci:** upload sdks to package manager ([6f15584](https://github.com/riza-io/riza-api-python/commit/6f15584c25e495105f80fe0728b693335a431355))
29+
* **docs:** grammar improvements ([8254ef9](https://github.com/riza-io/riza-api-python/commit/8254ef91bec882adfb05e4d86dfc13c0b0abcaca))
30+
* **docs:** remove reference to rye shell ([e7c147b](https://github.com/riza-io/riza-api-python/commit/e7c147beb4fc7f74c0e883389c53e2490863a8e2))
31+
* **docs:** remove unnecessary param examples ([5dc8d89](https://github.com/riza-io/riza-api-python/commit/5dc8d89c62b934da26ef8a588a26452e64aec895))
32+
* **internal:** avoid errors for isinstance checks on proxies ([df06fdf](https://github.com/riza-io/riza-api-python/commit/df06fdf1fd3534a47862a98e9df3868dc8813dd9))
33+
* **internal:** update conftest.py ([bd8931e](https://github.com/riza-io/riza-api-python/commit/bd8931e52ca3ae4591b692aafeded90dfc1d20fd))
34+
* **readme:** update badges ([9399af4](https://github.com/riza-io/riza-api-python/commit/9399af448b09b28392d91f980fbf2ef5f54b2364))
35+
* **tests:** add tests for httpx client instantiation & proxies ([81ec20b](https://github.com/riza-io/riza-api-python/commit/81ec20b4c46eacb48f8f715aa195d621e2e663de))
36+
* **tests:** run tests in parallel ([9c06af9](https://github.com/riza-io/riza-api-python/commit/9c06af9e919b3037638e51813d6172d6f5e9318e))
37+
* **tests:** skip some failing tests on the latest python versions ([afe509f](https://github.com/riza-io/riza-api-python/commit/afe509f0aad8d8e1f75a4a55af506f7ec178005a))
38+
39+
40+
### Documentation
41+
42+
* **client:** fix httpx.Timeout documentation reference ([75b4f8d](https://github.com/riza-io/riza-api-python/commit/75b4f8d02e06917aa76e2321b65425aa59c7bf57))
43+
344
## 0.11.0 (2025-04-24)
445

546
Full Changelog: [v0.10.0...v0.11.0](https://github.com/riza-io/riza-api-python/compare/v0.10.0...v0.11.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: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Riza Python API library
22

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

55
The Riza Python library provides convenient access to the Riza REST API from any Python 3.8+
66
application. The library includes type definitions for all request params and response fields,
@@ -35,7 +35,7 @@ response = client.command.exec(
3535
code="print('Hello, World!')",
3636
language="python",
3737
)
38-
print(response.duration)
38+
print(response.id)
3939
```
4040

4141
While you can provide an `api_key` keyword argument,
@@ -62,14 +62,49 @@ async def main() -> None:
6262
code="print('Hello, World!')",
6363
language="python",
6464
)
65-
print(response.duration)
65+
print(response.id)
6666

6767

6868
asyncio.run(main())
6969
```
7070

7171
Functionality between the synchronous and asynchronous clients is otherwise identical.
7272

73+
### With aiohttp
74+
75+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
76+
77+
You can enable this by installing `aiohttp`:
78+
79+
```sh
80+
# install from PyPI
81+
pip install rizaio[aiohttp]
82+
```
83+
84+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
85+
86+
```python
87+
import os
88+
import asyncio
89+
from rizaio import DefaultAioHttpClient
90+
from rizaio import AsyncRiza
91+
92+
93+
async def main() -> None:
94+
async with AsyncRiza(
95+
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
96+
http_client=DefaultAioHttpClient(),
97+
) as client:
98+
response = await client.command.exec(
99+
code="print('Hello, World!')",
100+
language="python",
101+
)
102+
print(response.id)
103+
104+
105+
asyncio.run(main())
106+
```
107+
73108
## Using types
74109

75110
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
@@ -91,28 +126,7 @@ client = Riza()
91126
response = client.command.exec(
92127
code='print("Hello world!")',
93128
language="python",
94-
http={
95-
"allow": [
96-
{
97-
"auth": {
98-
"basic": {
99-
"password": "password",
100-
"user_id": "user_id",
101-
},
102-
"bearer": {"token": "token"},
103-
"header": {
104-
"name": "name",
105-
"value": "value",
106-
},
107-
"query": {
108-
"key": "key",
109-
"value": "value",
110-
},
111-
},
112-
"host": "host",
113-
}
114-
]
115-
},
129+
http={},
116130
)
117131
print(response.http)
118132
```
@@ -188,7 +202,7 @@ client.with_options(max_retries=5).command.exec(
188202
### Timeouts
189203

190204
By default requests time out after 1 minute. You can configure this with a `timeout` option,
191-
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
205+
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
192206

193207
```python
194208
from rizaio import Riza
@@ -256,7 +270,7 @@ response = client.command.with_raw_response.exec(
256270
print(response.headers.get('X-My-Header'))
257271

258272
command = response.parse() # get the object that `command.exec()` would have returned
259-
print(command.duration)
273+
print(command.id)
260274
```
261275

262276
These methods return an [`APIResponse`](https://github.com/riza-io/riza-api-python/tree/main/src/rizaio/_response.py) object.

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Riza please follow the respective company's security reporting guidelines.
19+
or products provided by Riza, please follow the respective company's security reporting guidelines.
2020

2121
### Riza Terms and Policies
2222

23-
Please contact hello@riza.io for any questions or concerns regarding security of our services.
23+
Please contact hello@riza.io for any questions or concerns regarding the security of our services.
2424

2525
---
2626

api.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ Methods:
4545
Types:
4646

4747
```python
48-
from rizaio.types import Runtime
48+
from rizaio.types import Runtime, RuntimeDeleteResponse
4949
```
5050

5151
Methods:
5252

5353
- <code title="post /v1/runtimes">client.runtimes.<a href="./src/rizaio/resources/runtimes/runtimes.py">create</a>(\*\*<a href="src/rizaio/types/runtime_create_params.py">params</a>) -> <a href="./src/rizaio/types/runtime.py">Runtime</a></code>
5454
- <code title="get /v1/runtimes">client.runtimes.<a href="./src/rizaio/resources/runtimes/runtimes.py">list</a>(\*\*<a href="src/rizaio/types/runtime_list_params.py">params</a>) -> <a href="./src/rizaio/types/runtime.py">SyncRuntimesPagination[Runtime]</a></code>
55+
- <code title="delete /v1/runtimes/{id}">client.runtimes.<a href="./src/rizaio/resources/runtimes/runtimes.py">delete</a>(id) -> <a href="./src/rizaio/types/runtime_delete_response.py">RuntimeDeleteResponse</a></code>
5556
- <code title="get /v1/runtimes/{id}">client.runtimes.<a href="./src/rizaio/resources/runtimes/runtimes.py">get</a>(id) -> <a href="./src/rizaio/types/runtime.py">Runtime</a></code>
5657

5758
## Revisions
@@ -67,3 +68,16 @@ Methods:
6768
- <code title="post /v1/runtimes/{id}/revisions">client.runtimes.revisions.<a href="./src/rizaio/resources/runtimes/revisions.py">create</a>(id, \*\*<a href="src/rizaio/types/runtimes/revision_create_params.py">params</a>) -> <a href="./src/rizaio/types/runtimes/revision.py">Revision</a></code>
6869
- <code title="get /v1/runtimes/{id}/revisions">client.runtimes.revisions.<a href="./src/rizaio/resources/runtimes/revisions.py">list</a>(id) -> <a href="./src/rizaio/types/runtimes/revision_list_response.py">RevisionListResponse</a></code>
6970
- <code title="get /v1/runtimes/{runtime_id}/revisions/{revision_id}">client.runtimes.revisions.<a href="./src/rizaio/resources/runtimes/revisions.py">get</a>(revision_id, \*, runtime_id) -> <a href="./src/rizaio/types/runtimes/revision.py">Revision</a></code>
71+
72+
# Executions
73+
74+
Types:
75+
76+
```python
77+
from rizaio.types import Execution
78+
```
79+
80+
Methods:
81+
82+
- <code title="get /v1/executions">client.executions.<a href="./src/rizaio/resources/executions.py">list</a>(\*\*<a href="src/rizaio/types/execution_list_params.py">params</a>) -> <a href="./src/rizaio/types/execution.py">SyncDefaultPagination[Execution]</a></code>
83+
- <code title="get /v1/executions/{id}">client.executions.<a href="./src/rizaio/resources/executions.py">get</a>(id) -> <a href="./src/rizaio/types/execution.py">Execution</a></code>

bin/check-release-environment

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
errors=()
44

55
if [ -z "${PYPI_TOKEN}" ]; then
6-
errors+=("The RIZA_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
6+
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
77
fi
88

99
lenErrors=${#errors[@]}

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rizaio"
3-
version = "0.11.0"
3+
version = "0.12.0"
44
description = "The official Python library for the riza API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -37,6 +37,8 @@ classifiers = [
3737
Homepage = "https://github.com/riza-io/riza-api-python"
3838
Repository = "https://github.com/riza-io/riza-api-python"
3939

40+
[project.optional-dependencies]
41+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
4042

4143
[tool.rye]
4244
managed = true
@@ -54,6 +56,7 @@ dev-dependencies = [
5456
"importlib-metadata>=6.7.0",
5557
"rich>=13.7.1",
5658
"nest_asyncio==1.6.0",
59+
"pytest-xdist>=3.6.1",
5760
]
5861

5962
[tool.rye.scripts]
@@ -125,7 +128,7 @@ replacement = '[\1](https://github.com/riza-io/riza-api-python/tree/main/\g<2>)'
125128

126129
[tool.pytest.ini_options]
127130
testpaths = ["tests"]
128-
addopts = "--tb=short"
131+
addopts = "--tb=short -n auto"
129132
xfail_strict = true
130133
asyncio_mode = "auto"
131134
asyncio_default_fixture_loop_scope = "session"

0 commit comments

Comments
 (0)