diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b7c8ed7..2543fb8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.1.5" + ".": "2.1.6" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3075454..7fd4187 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 2.1.6 (2024-12-18) + +Full Changelog: [v2.1.5...v2.1.6](https://github.com/runwayml/sdk-python/compare/v2.1.5...v2.1.6) + +### Chores + +* **internal:** codegen related update ([#48](https://github.com/runwayml/sdk-python/issues/48)) ([f999274](https://github.com/runwayml/sdk-python/commit/f999274cbc241f063e3f6abdd7bef93749066c05)) +* **internal:** codegen related update ([#50](https://github.com/runwayml/sdk-python/issues/50)) ([187e174](https://github.com/runwayml/sdk-python/commit/187e1747d62dc99718de5d2dfb5bc8fa8291ab34)) +* **internal:** codegen related update ([#51](https://github.com/runwayml/sdk-python/issues/51)) ([1c70164](https://github.com/runwayml/sdk-python/commit/1c701642c7797d49ce59bc938b0f18511f3c6d9e)) +* **internal:** codegen related update ([#52](https://github.com/runwayml/sdk-python/issues/52)) ([07e7dda](https://github.com/runwayml/sdk-python/commit/07e7ddaae96eb26063a88e6bc23adef2f9b0e7d5)) +* **internal:** codegen related update ([#54](https://github.com/runwayml/sdk-python/issues/54)) ([5540248](https://github.com/runwayml/sdk-python/commit/55402489160f4cb43244f90e5f85c90bd96a7729)) +* **internal:** codegen related update ([#55](https://github.com/runwayml/sdk-python/issues/55)) ([75daba1](https://github.com/runwayml/sdk-python/commit/75daba1936f201824daec2b8b08abf68a52b55d7)) +* **internal:** codegen related update ([#56](https://github.com/runwayml/sdk-python/issues/56)) ([c98ed80](https://github.com/runwayml/sdk-python/commit/c98ed80958344be95507a3c5ef7ede3006cf6bf5)) +* **internal:** fix some typos ([#58](https://github.com/runwayml/sdk-python/issues/58)) ([404c771](https://github.com/runwayml/sdk-python/commit/404c771242c581f9c618966a03b5de5f5db8a5da)) + + +### Documentation + +* **readme:** example snippet for client context manager ([#57](https://github.com/runwayml/sdk-python/issues/57)) ([e62b5e9](https://github.com/runwayml/sdk-python/commit/e62b5e9d1176d72c7285ede6200436bc994260ae)) + ## 2.1.5 (2024-12-13) Full Changelog: [v2.1.4...v2.1.5](https://github.com/runwayml/sdk-python/compare/v2.1.4...v2.1.5) diff --git a/README.md b/README.md index b473eca..34fc27f 100644 --- a/README.md +++ b/README.md @@ -318,6 +318,16 @@ client.with_options(http_client=DefaultHttpxClient(...)) By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. +```py +from runwayml import RunwayML + +with RunwayML() as client: + # make requests here + ... + +# HTTP client is now closed +``` + ## Versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: diff --git a/pyproject.toml b/pyproject.toml index 95a3f36..37fb0f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runwayml" -version = "2.1.5" +version = "2.1.6" description = "The official Python library for the runwayml API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/runwayml/_client.py b/src/runwayml/_client.py index de44a55..db553d7 100644 --- a/src/runwayml/_client.py +++ b/src/runwayml/_client.py @@ -8,7 +8,7 @@ import httpx -from . import resources, _exceptions +from . import _exceptions from ._qs import Querystring from ._types import ( NOT_GIVEN, @@ -24,6 +24,7 @@ get_async_library, ) from ._version import __version__ +from .resources import tasks, image_to_video from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import RunwayMLError, APIStatusError from ._base_client import ( @@ -37,7 +38,6 @@ "Transport", "ProxiesTypes", "RequestOptions", - "resources", "RunwayML", "AsyncRunwayML", "Client", @@ -46,8 +46,8 @@ class RunwayML(SyncAPIClient): - tasks: resources.TasksResource - image_to_video: resources.ImageToVideoResource + tasks: tasks.TasksResource + image_to_video: image_to_video.ImageToVideoResource with_raw_response: RunwayMLWithRawResponse with_streaming_response: RunwayMLWithStreamedResponse @@ -111,8 +111,8 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.tasks = resources.TasksResource(self) - self.image_to_video = resources.ImageToVideoResource(self) + self.tasks = tasks.TasksResource(self) + self.image_to_video = image_to_video.ImageToVideoResource(self) self.with_raw_response = RunwayMLWithRawResponse(self) self.with_streaming_response = RunwayMLWithStreamedResponse(self) @@ -225,8 +225,8 @@ def _make_status_error( class AsyncRunwayML(AsyncAPIClient): - tasks: resources.AsyncTasksResource - image_to_video: resources.AsyncImageToVideoResource + tasks: tasks.AsyncTasksResource + image_to_video: image_to_video.AsyncImageToVideoResource with_raw_response: AsyncRunwayMLWithRawResponse with_streaming_response: AsyncRunwayMLWithStreamedResponse @@ -290,8 +290,8 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.tasks = resources.AsyncTasksResource(self) - self.image_to_video = resources.AsyncImageToVideoResource(self) + self.tasks = tasks.AsyncTasksResource(self) + self.image_to_video = image_to_video.AsyncImageToVideoResource(self) self.with_raw_response = AsyncRunwayMLWithRawResponse(self) self.with_streaming_response = AsyncRunwayMLWithStreamedResponse(self) @@ -405,26 +405,26 @@ def _make_status_error( class RunwayMLWithRawResponse: def __init__(self, client: RunwayML) -> None: - self.tasks = resources.TasksResourceWithRawResponse(client.tasks) - self.image_to_video = resources.ImageToVideoResourceWithRawResponse(client.image_to_video) + self.tasks = tasks.TasksResourceWithRawResponse(client.tasks) + self.image_to_video = image_to_video.ImageToVideoResourceWithRawResponse(client.image_to_video) class AsyncRunwayMLWithRawResponse: def __init__(self, client: AsyncRunwayML) -> None: - self.tasks = resources.AsyncTasksResourceWithRawResponse(client.tasks) - self.image_to_video = resources.AsyncImageToVideoResourceWithRawResponse(client.image_to_video) + self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks) + self.image_to_video = image_to_video.AsyncImageToVideoResourceWithRawResponse(client.image_to_video) class RunwayMLWithStreamedResponse: def __init__(self, client: RunwayML) -> None: - self.tasks = resources.TasksResourceWithStreamingResponse(client.tasks) - self.image_to_video = resources.ImageToVideoResourceWithStreamingResponse(client.image_to_video) + self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks) + self.image_to_video = image_to_video.ImageToVideoResourceWithStreamingResponse(client.image_to_video) class AsyncRunwayMLWithStreamedResponse: def __init__(self, client: AsyncRunwayML) -> None: - self.tasks = resources.AsyncTasksResourceWithStreamingResponse(client.tasks) - self.image_to_video = resources.AsyncImageToVideoResourceWithStreamingResponse(client.image_to_video) + self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks) + self.image_to_video = image_to_video.AsyncImageToVideoResourceWithStreamingResponse(client.image_to_video) Client = RunwayML diff --git a/src/runwayml/_version.py b/src/runwayml/_version.py index b6bfc50..2d79f6a 100644 --- a/src/runwayml/_version.py +++ b/src/runwayml/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runwayml" -__version__ = "2.1.5" # x-release-please-version +__version__ = "2.1.6" # x-release-please-version diff --git a/tests/test_client.py b/tests/test_client.py index 809172b..1d41755 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -355,11 +355,11 @@ def test_default_query_option(self) -> None: FinalRequestOptions( method="get", url="/foo", - params={"foo": "baz", "query_param": "overriden"}, + params={"foo": "baz", "query_param": "overridden"}, ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} def test_request_extra_json(self) -> None: request = self.client._build_request( @@ -1137,11 +1137,11 @@ def test_default_query_option(self) -> None: FinalRequestOptions( method="get", url="/foo", - params={"foo": "baz", "query_param": "overriden"}, + params={"foo": "baz", "query_param": "overridden"}, ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} def test_request_extra_json(self) -> None: request = self.client._build_request(