From a3424598359f12f2fc10b64b9bce5a93cc8a21ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 14:32:23 -0800 Subject: [PATCH] release: 0.6.0 (#107) * 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> --- .release-please-manifest.json | 2 +- .stats.yml | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/rizaio/_version.py | 2 +- src/rizaio/resources/command.py | 16 ++++++++-------- src/rizaio/types/command_exec_params.py | 6 +++--- tests/api_resources/test_command.py | 10 ++++++++-- tests/test_client.py | 12 ++++++------ 9 files changed, 37 insertions(+), 23 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2aca35a..4208b5c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.0" + ".": "0.6.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index cdad2d4..8933ba6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 35988a1..fa8a7a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 1e59c27..563178b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/rizaio/_version.py b/src/rizaio/_version.py index ff815bd..56ebab0 100644 --- a/src/rizaio/_version.py +++ b/src/rizaio/_version.py @@ -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 diff --git a/src/rizaio/resources/command.py b/src/rizaio/resources/command.py index b6f21e9..ffc8302 100644 --- a/src/rizaio/resources/command.py +++ b/src/rizaio/resources/command.py @@ -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, @@ -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. @@ -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. @@ -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, @@ -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, @@ -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. @@ -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. @@ -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, diff --git a/src/rizaio/types/command_exec_params.py b/src/rizaio/types/command_exec_params.py index 5d79063..6bf93e9 100644 --- a/src/rizaio/types/command_exec_params.py +++ b/src/rizaio/types/command_exec_params.py @@ -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.""" @@ -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.""" diff --git a/tests/api_resources/test_command.py b/tests/api_resources/test_command.py index d077321..757fc4d 100644 --- a/tests/api_resources/test_command.py +++ b/tests/api_resources/test_command.py @@ -21,6 +21,7 @@ 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"]) @@ -28,6 +29,7 @@ def test_method_exec(self, client: Riza) -> None: 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"}, @@ -59,7 +61,6 @@ def test_method_exec_with_all_params(self, client: Riza) -> None: } ] }, - language="python", limits={ "execution_timeout": 0, "memory_size": 0, @@ -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 @@ -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" @@ -101,6 +104,7 @@ 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"]) @@ -108,6 +112,7 @@ async def test_method_exec(self, async_client: AsyncRiza) -> None: 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"}, @@ -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, @@ -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 @@ -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" diff --git a/tests/test_client.py b/tests/test_client.py index 644ce9d..f09f217 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -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 @@ -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 @@ -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" @@ -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 @@ -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 @@ -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"