Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
df06fdf
chore(internal): avoid errors for isinstance checks on proxies
stainless-app[bot] May 9, 2025
5a8f2bd
fix(package): support direct resource imports
stainless-app[bot] May 10, 2025
6f15584
chore(ci): upload sdks to package manager
stainless-app[bot] May 15, 2025
dbfcc81
chore(ci): fix installation instructions
stainless-app[bot] May 16, 2025
8254ef9
chore(docs): grammar improvements
stainless-app[bot] May 22, 2025
e7c147b
chore(docs): remove reference to rye shell
stainless-app[bot] Jun 3, 2025
5dc8d89
chore(docs): remove unnecessary param examples
stainless-app[bot] Jun 3, 2025
729c66e
feat(client): add follow_redirects request option
stainless-app[bot] Jun 3, 2025
333d168
feat(api): api update
stainless-app[bot] Jun 12, 2025
9c06af9
chore(tests): run tests in parallel
stainless-app[bot] Jun 13, 2025
2b6e46f
fix(client): correctly parse binary response | stream
stainless-app[bot] Jun 13, 2025
cd2c84c
codegen metadata
stainless-app[bot] Jun 14, 2025
2c5c78d
codegen metadata
stainless-app[bot] Jun 16, 2025
81ec20b
chore(tests): add tests for httpx client instantiation & proxies
stainless-app[bot] Jun 17, 2025
bd8931e
chore(internal): update conftest.py
stainless-app[bot] Jun 17, 2025
ce5b546
chore(ci): enable for pull requests
stainless-app[bot] Jun 17, 2025
90483e2
codegen metadata
stainless-app[bot] Jun 17, 2025
a05d13a
codegen metadata
stainless-app[bot] Jun 17, 2025
9399af4
chore(readme): update badges
stainless-app[bot] Jun 18, 2025
4ebdf17
fix(tests): fix: tests which call HTTP endpoints directly with the ex…
stainless-app[bot] Jun 18, 2025
75b4f8d
docs(client): fix httpx.Timeout documentation reference
stainless-app[bot] Jun 19, 2025
b433926
feat(client): add support for aiohttp
stainless-app[bot] Jun 21, 2025
afe509f
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 24, 2025
ab3a1f5
feat(api): api update
stainless-app[bot] Jun 28, 2025
54b8081
feat(api): api update
stainless-app[bot] Jun 29, 2025
345e02a
feat(api): api update
stainless-app[bot] Jun 29, 2025
302d5dc
release: 0.12.0
stainless-app[bot] Jun 29, 2025
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
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/riza-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -30,10 +35,35 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
if: github.repository == 'stainless-sdks/riza-api-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh

test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/riza-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

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 @@
{
".": "0.11.0"
".": "0.12.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-f9777846c474c861e6c31174f8f08fd46a68a896609c8841b924d4ba4cb6979b.yml
openapi_spec_hash: 65364a3f3566c609aaed0b5c69600540
config_hash: 8ac0e6ef0ce0f5388eed4f14e515a7c9
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-bab65e0b0c2b228ee407ddd78cdcd7f3708bac6d00c0ada71efc6eef73de20fe.yml
openapi_spec_hash: 08c3a26bba78a202f09b51c2d4eb0001
config_hash: cba1727a13fc23eaeb011480ac88a06d
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Changelog

## 0.12.0 (2025-06-29)

Full Changelog: [v0.11.0...v0.12.0](https://github.com/riza-io/riza-api-python/compare/v0.11.0...v0.12.0)

### Features

* **api:** api update ([345e02a](https://github.com/riza-io/riza-api-python/commit/345e02a9e93c2ca9a26ce0f884dc9a018cd495cd))
* **api:** api update ([54b8081](https://github.com/riza-io/riza-api-python/commit/54b808196ab410711a60e1e6eafc809045255580))
* **api:** api update ([ab3a1f5](https://github.com/riza-io/riza-api-python/commit/ab3a1f5a2597a2407a96124c5bbd620eb61aed1a))
* **api:** api update ([333d168](https://github.com/riza-io/riza-api-python/commit/333d1682a5d6f11000efba046a7874a156a6b4da))
* **client:** add follow_redirects request option ([729c66e](https://github.com/riza-io/riza-api-python/commit/729c66e844308a7a56c4a7c56ce5af42f4abed0d))
* **client:** add support for aiohttp ([b433926](https://github.com/riza-io/riza-api-python/commit/b433926d78e66e1234125f155aa6f2458be768ea))


### Bug Fixes

* **client:** correctly parse binary response | stream ([2b6e46f](https://github.com/riza-io/riza-api-python/commit/2b6e46ffc653e27831681d2a6e3719f6f2e79d4d))
* **package:** support direct resource imports ([5a8f2bd](https://github.com/riza-io/riza-api-python/commit/5a8f2bd588ed788643b59c1f64bf88af21f8774e))
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([4ebdf17](https://github.com/riza-io/riza-api-python/commit/4ebdf17f9eba4d440261e307da12be148e4ab8c8))


### Chores

* **ci:** enable for pull requests ([ce5b546](https://github.com/riza-io/riza-api-python/commit/ce5b546ced715900bff3f6d5a965ff482c20d46c))
* **ci:** fix installation instructions ([dbfcc81](https://github.com/riza-io/riza-api-python/commit/dbfcc815e5022d343677c8eae511024949838c37))
* **ci:** upload sdks to package manager ([6f15584](https://github.com/riza-io/riza-api-python/commit/6f15584c25e495105f80fe0728b693335a431355))
* **docs:** grammar improvements ([8254ef9](https://github.com/riza-io/riza-api-python/commit/8254ef91bec882adfb05e4d86dfc13c0b0abcaca))
* **docs:** remove reference to rye shell ([e7c147b](https://github.com/riza-io/riza-api-python/commit/e7c147beb4fc7f74c0e883389c53e2490863a8e2))
* **docs:** remove unnecessary param examples ([5dc8d89](https://github.com/riza-io/riza-api-python/commit/5dc8d89c62b934da26ef8a588a26452e64aec895))
* **internal:** avoid errors for isinstance checks on proxies ([df06fdf](https://github.com/riza-io/riza-api-python/commit/df06fdf1fd3534a47862a98e9df3868dc8813dd9))
* **internal:** update conftest.py ([bd8931e](https://github.com/riza-io/riza-api-python/commit/bd8931e52ca3ae4591b692aafeded90dfc1d20fd))
* **readme:** update badges ([9399af4](https://github.com/riza-io/riza-api-python/commit/9399af448b09b28392d91f980fbf2ef5f54b2364))
* **tests:** add tests for httpx client instantiation & proxies ([81ec20b](https://github.com/riza-io/riza-api-python/commit/81ec20b4c46eacb48f8f715aa195d621e2e663de))
* **tests:** run tests in parallel ([9c06af9](https://github.com/riza-io/riza-api-python/commit/9c06af9e919b3037638e51813d6172d6f5e9318e))
* **tests:** skip some failing tests on the latest python versions ([afe509f](https://github.com/riza-io/riza-api-python/commit/afe509f0aad8d8e1f75a4a55af506f7ec178005a))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([75b4f8d](https://github.com/riza-io/riza-api-python/commit/75b4f8d02e06917aa76e2321b65425aa59c7bf57))

## 0.11.0 (2025-04-24)

Full Changelog: [v0.10.0...v0.11.0](https://github.com/riza-io/riza-api-python/compare/v0.10.0...v0.11.0)
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ $ rye sync --all-features
You can then run scripts using `rye run python script.py` or by activating the virtual environment:

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

# now you can omit the `rye run` prefix
Expand Down
68 changes: 41 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Riza Python API library

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

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

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


asyncio.run(main())
```

Functionality between the synchronous and asynchronous clients is otherwise identical.

### With aiohttp

By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.

You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install rizaio[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from rizaio import DefaultAioHttpClient
from rizaio import AsyncRiza


async def main() -> None:
async with AsyncRiza(
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
response = await client.command.exec(
code="print('Hello, World!')",
language="python",
)
print(response.id)


asyncio.run(main())
```

## Using types

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:
Expand All @@ -91,28 +126,7 @@ client = Riza()
response = client.command.exec(
code='print("Hello world!")',
language="python",
http={
"allow": [
{
"auth": {
"basic": {
"password": "password",
"user_id": "user_id",
},
"bearer": {"token": "token"},
"header": {
"name": "name",
"value": "value",
},
"query": {
"key": "key",
"value": "value",
},
},
"host": "host",
}
]
},
http={},
)
print(response.http)
```
Expand Down Expand Up @@ -188,7 +202,7 @@ client.with_options(max_retries=5).command.exec(
### Timeouts

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

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

command = response.parse() # get the object that `command.exec()` would have returned
print(command.duration)
print(command.id)
```

These methods return an [`APIResponse`](https://github.com/riza-io/riza-api-python/tree/main/src/rizaio/_response.py) object.
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

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

### Riza Terms and Policies

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

---

Expand Down
16 changes: 15 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ Methods:
Types:

```python
from rizaio.types import Runtime
from rizaio.types import Runtime, RuntimeDeleteResponse
```

Methods:

- <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>
- <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>
- <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>
- <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>

## Revisions
Expand All @@ -67,3 +68,16 @@ Methods:
- <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>
- <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>
- <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>

# Executions

Types:

```python
from rizaio.types import Execution
```

Methods:

- <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>
- <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>
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

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

lenErrors=${#errors[@]}
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rizaio"
version = "0.11.0"
version = "0.12.0"
description = "The official Python library for the riza API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -37,6 +37,8 @@ classifiers = [
Homepage = "https://github.com/riza-io/riza-api-python"
Repository = "https://github.com/riza-io/riza-api-python"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]

[tool.rye]
managed = true
Expand All @@ -54,6 +56,7 @@ dev-dependencies = [
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

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

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--tb=short"
addopts = "--tb=short -n auto"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
Expand Down
Loading