Skip to content

Commit

Permalink
release: 0.6.0 (#107)
Browse files Browse the repository at this point in the history
* feat(api): api update (#106)

* codegen metadata

* codegen metadata

* codegen metadata

* codegen metadata

* release: 0.6.0

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
  • Loading branch information
stainless-app[bot] authored Jan 16, 2025
1 parent 2b5baae commit a342459
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 23 deletions.
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.5.0"
".": "0.6.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-fbf471c508c87d8f33abb016566e4a23c1a188f8097af9bab707cd0f13c0663b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-00b3e89b997ff405b283aa320524d82ac961a9766eb1d23b8f315a4f850ae97d.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.6.0 (2025-01-16)

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

### Features

* **api:** api update ([#106](https://github.com/riza-io/riza-api-python/issues/106)) ([1cc6f50](https://github.com/riza-io/riza-api-python/commit/1cc6f500aeb590cc1523e6f072de0ebe66b8525b))

## 0.5.0 (2025-01-10)

Full Changelog: [v0.4.0...v0.5.0](https://github.com/riza-io/riza-api-python/compare/v0.4.0...v0.5.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rizaio"
version = "0.5.0"
version = "0.6.0"
description = "The official Python library for the riza API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/rizaio/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "rizaio"
__version__ = "0.5.0" # x-release-please-version
__version__ = "0.6.0" # x-release-please-version
16 changes: 8 additions & 8 deletions src/rizaio/resources/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def exec(
self,
*,
code: str,
language: Literal["python", "javascript", "typescript", "ruby", "php"],
allow_http_hosts: List[str] | NotGiven = NOT_GIVEN,
args: List[str] | NotGiven = NOT_GIVEN,
env: Dict[str, str] | NotGiven = NOT_GIVEN,
files: Iterable[command_exec_params.File] | NotGiven = NOT_GIVEN,
http: Optional[command_exec_params.HTTP] | NotGiven = NOT_GIVEN,
language: Literal["python", "javascript", "typescript", "ruby", "php"] | NotGiven = NOT_GIVEN,
limits: Optional[command_exec_params.Limits] | NotGiven = NOT_GIVEN,
runtime_revision_id: str | NotGiven = NOT_GIVEN,
stdin: str | NotGiven = NOT_GIVEN,
Expand All @@ -76,6 +76,8 @@ def exec(
Args:
code: The code to execute.
language: The interpreter to use when executing code.
allow_http_hosts: List of allowed hosts for HTTP requests.
args: List of command line arguments to pass to the script.
Expand All @@ -86,8 +88,6 @@ def exec(
http: Configuration for HTTP requests and authentication.
language: The interpreter to use when executing code.
limits: Configuration for execution environment limits.
runtime_revision_id: The ID of the runtime revision to use when executing code.
Expand All @@ -107,12 +107,12 @@ def exec(
body=maybe_transform(
{
"code": code,
"language": language,
"allow_http_hosts": allow_http_hosts,
"args": args,
"env": env,
"files": files,
"http": http,
"language": language,
"limits": limits,
"runtime_revision_id": runtime_revision_id,
"stdin": stdin,
Expand Down Expand Up @@ -150,12 +150,12 @@ async def exec(
self,
*,
code: str,
language: Literal["python", "javascript", "typescript", "ruby", "php"],
allow_http_hosts: List[str] | NotGiven = NOT_GIVEN,
args: List[str] | NotGiven = NOT_GIVEN,
env: Dict[str, str] | NotGiven = NOT_GIVEN,
files: Iterable[command_exec_params.File] | NotGiven = NOT_GIVEN,
http: Optional[command_exec_params.HTTP] | NotGiven = NOT_GIVEN,
language: Literal["python", "javascript", "typescript", "ruby", "php"] | NotGiven = NOT_GIVEN,
limits: Optional[command_exec_params.Limits] | NotGiven = NOT_GIVEN,
runtime_revision_id: str | NotGiven = NOT_GIVEN,
stdin: str | NotGiven = NOT_GIVEN,
Expand All @@ -175,6 +175,8 @@ async def exec(
Args:
code: The code to execute.
language: The interpreter to use when executing code.
allow_http_hosts: List of allowed hosts for HTTP requests.
args: List of command line arguments to pass to the script.
Expand All @@ -185,8 +187,6 @@ async def exec(
http: Configuration for HTTP requests and authentication.
language: The interpreter to use when executing code.
limits: Configuration for execution environment limits.
runtime_revision_id: The ID of the runtime revision to use when executing code.
Expand All @@ -206,12 +206,12 @@ async def exec(
body=await async_maybe_transform(
{
"code": code,
"language": language,
"allow_http_hosts": allow_http_hosts,
"args": args,
"env": env,
"files": files,
"http": http,
"language": language,
"limits": limits,
"runtime_revision_id": runtime_revision_id,
"stdin": stdin,
Expand Down
6 changes: 3 additions & 3 deletions src/rizaio/types/command_exec_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class CommandExecParams(TypedDict, total=False):
code: Required[str]
"""The code to execute."""

language: Required[Literal["python", "javascript", "typescript", "ruby", "php"]]
"""The interpreter to use when executing code."""

allow_http_hosts: List[str]
"""List of allowed hosts for HTTP requests."""

Expand All @@ -38,9 +41,6 @@ class CommandExecParams(TypedDict, total=False):
http: Optional[HTTP]
"""Configuration for HTTP requests and authentication."""

language: Literal["python", "javascript", "typescript", "ruby", "php"]
"""The interpreter to use when executing code."""

limits: Optional[Limits]
"""Configuration for execution environment limits."""

Expand Down
10 changes: 8 additions & 2 deletions tests/api_resources/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ class TestCommand:
def test_method_exec(self, client: Riza) -> None:
command = client.command.exec(
code='print("Hello world!")',
language="python",
)
assert_matches_type(CommandExecResponse, command, path=["response"])

@parametrize
def test_method_exec_with_all_params(self, client: Riza) -> None:
command = client.command.exec(
code='print("Hello world!")',
language="python",
allow_http_hosts=["string"],
args=["string"],
env={"foo": "string"},
Expand Down Expand Up @@ -59,7 +61,6 @@ def test_method_exec_with_all_params(self, client: Riza) -> None:
}
]
},
language="python",
limits={
"execution_timeout": 0,
"memory_size": 0,
Expand All @@ -73,6 +74,7 @@ def test_method_exec_with_all_params(self, client: Riza) -> None:
def test_raw_response_exec(self, client: Riza) -> None:
response = client.command.with_raw_response.exec(
code='print("Hello world!")',
language="python",
)

assert response.is_closed is True
Expand All @@ -84,6 +86,7 @@ def test_raw_response_exec(self, client: Riza) -> None:
def test_streaming_response_exec(self, client: Riza) -> None:
with client.command.with_streaming_response.exec(
code='print("Hello world!")',
language="python",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -101,13 +104,15 @@ class TestAsyncCommand:
async def test_method_exec(self, async_client: AsyncRiza) -> None:
command = await async_client.command.exec(
code='print("Hello world!")',
language="python",
)
assert_matches_type(CommandExecResponse, command, path=["response"])

@parametrize
async def test_method_exec_with_all_params(self, async_client: AsyncRiza) -> None:
command = await async_client.command.exec(
code='print("Hello world!")',
language="python",
allow_http_hosts=["string"],
args=["string"],
env={"foo": "string"},
Expand Down Expand Up @@ -139,7 +144,6 @@ async def test_method_exec_with_all_params(self, async_client: AsyncRiza) -> Non
}
]
},
language="python",
limits={
"execution_timeout": 0,
"memory_size": 0,
Expand All @@ -153,6 +157,7 @@ async def test_method_exec_with_all_params(self, async_client: AsyncRiza) -> Non
async def test_raw_response_exec(self, async_client: AsyncRiza) -> None:
response = await async_client.command.with_raw_response.exec(
code='print("Hello world!")',
language="python",
)

assert response.is_closed is True
Expand All @@ -164,6 +169,7 @@ async def test_raw_response_exec(self, async_client: AsyncRiza) -> None:
async def test_streaming_response_exec(self, async_client: AsyncRiza) -> None:
async with async_client.command.with_streaming_response.exec(
code='print("Hello world!")',
language="python",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down
12 changes: 6 additions & 6 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:

respx_mock.post("/v1/execute").mock(side_effect=retry_handler)

response = client.command.with_raw_response.exec(code='print("Hello world!")')
response = client.command.with_raw_response.exec(code='print("Hello world!")', language="python")

assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
Expand All @@ -774,7 +774,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
respx_mock.post("/v1/execute").mock(side_effect=retry_handler)

response = client.command.with_raw_response.exec(
code='print("Hello world!")', extra_headers={"x-stainless-retry-count": Omit()}
code='print("Hello world!")', language="python", extra_headers={"x-stainless-retry-count": Omit()}
)

assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
Expand All @@ -799,7 +799,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
respx_mock.post("/v1/execute").mock(side_effect=retry_handler)

response = client.command.with_raw_response.exec(
code='print("Hello world!")', extra_headers={"x-stainless-retry-count": "42"}
code='print("Hello world!")', language="python", extra_headers={"x-stainless-retry-count": "42"}
)

assert response.http_request.headers.get("x-stainless-retry-count") == "42"
Expand Down Expand Up @@ -1520,7 +1520,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:

respx_mock.post("/v1/execute").mock(side_effect=retry_handler)

response = await client.command.with_raw_response.exec(code='print("Hello world!")')
response = await client.command.with_raw_response.exec(code='print("Hello world!")', language="python")

assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
Expand All @@ -1546,7 +1546,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
respx_mock.post("/v1/execute").mock(side_effect=retry_handler)

response = await client.command.with_raw_response.exec(
code='print("Hello world!")', extra_headers={"x-stainless-retry-count": Omit()}
code='print("Hello world!")', language="python", extra_headers={"x-stainless-retry-count": Omit()}
)

assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
Expand All @@ -1572,7 +1572,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
respx_mock.post("/v1/execute").mock(side_effect=retry_handler)

response = await client.command.with_raw_response.exec(
code='print("Hello world!")', extra_headers={"x-stainless-retry-count": "42"}
code='print("Hello world!")', language="python", extra_headers={"x-stainless-retry-count": "42"}
)

assert response.http_request.headers.get("x-stainless-retry-count") == "42"
Expand Down

0 comments on commit a342459

Please sign in to comment.