diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 127ac87b..6a37fe2d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.0.0" + ".": "4.0.1" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 645b4c0b..cb4778c1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c2a4808c828c8288c5c8dfe2fdfa51d4d7c1bcc33cacc6b859d0cf4b35ce95cc.yml -openapi_spec_hash: a2b5a1bfabbd03dd1b411791576eb502 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d7b617958673f6e5b94781a63ed79caed27014e5ca8bbf7e5e31b8f4d135aecb.yml +openapi_spec_hash: 66e9c2cd22385eed3ed507ee60aed4f5 config_hash: 3c3524be9607afb24d2139ce26ce5389 diff --git a/CHANGELOG.md b/CHANGELOG.md index 01f2a1ea..f929bf3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 4.0.1 (2025-06-12) + +Full Changelog: [v4.0.0...v4.0.1](https://github.com/orbcorp/orb-python/compare/v4.0.0...v4.0.1) + +### Bug Fixes + +* **client:** correctly parse binary response | stream ([08ecc1c](https://github.com/orbcorp/orb-python/commit/08ecc1c10f8c26e66c02e333b89e910cedd61570)) + + +### Chores + +* **tests:** run tests in parallel ([f228f15](https://github.com/orbcorp/orb-python/commit/f228f15fa9f2fdaf5b7398a3f233aea4419ba3fb)) + ## 4.0.0 (2025-06-09) Full Changelog: [v3.24.0...v4.0.0](https://github.com/orbcorp/orb-python/compare/v3.24.0...v4.0.0) diff --git a/pyproject.toml b/pyproject.toml index 70da50d8..7315a5e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "4.0.0" +version = "4.0.1" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" @@ -54,6 +54,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] @@ -125,7 +126,7 @@ replacement = '[\1](https://github.com/orbcorp/orb-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" diff --git a/requirements-dev.lock b/requirements-dev.lock index 1596dacd..10dae689 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -30,6 +30,8 @@ distro==1.8.0 exceptiongroup==1.2.2 # via anyio # via pytest +execnet==2.1.1 + # via pytest-xdist filelock==3.12.4 # via virtualenv h11==0.14.0 @@ -72,7 +74,9 @@ pygments==2.18.0 pyright==1.1.399 pytest==8.3.3 # via pytest-asyncio + # via pytest-xdist pytest-asyncio==0.24.0 +pytest-xdist==3.7.0 python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 diff --git a/src/orb/_base_client.py b/src/orb/_base_client.py index 056620f0..79258719 100644 --- a/src/orb/_base_client.py +++ b/src/orb/_base_client.py @@ -1086,7 +1086,14 @@ def _process_response( origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, APIResponse): raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}") @@ -1603,7 +1610,14 @@ async def _process_response( origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, AsyncAPIResponse): raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}") diff --git a/src/orb/_version.py b/src/orb/_version.py index f6f2ef77..f7a7898e 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "orb" -__version__ = "4.0.0" # x-release-please-version +__version__ = "4.0.1" # x-release-please-version