From ea7d8b30d3f960def16a2484720df085a87be756 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:48:26 +0000 Subject: [PATCH 1/3] chore(readme): fix version rendering on pypi --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dd348e9..af2d95fc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Orb Python API library -[![PyPI version]()](https://pypi.org/project/orb-billing/) + +[![PyPI version](https://img.shields.io/pypi/v/orb-billing.svg?label=pypi%20(stable))](https://pypi.org/project/orb-billing/) The Orb Python library provides convenient access to the Orb REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, From 958c8b911c0b66d54e7f384f8fc4a7096a550a44 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:16:21 +0000 Subject: [PATCH 2/3] fix(client): don't send Content-Type header on GET requests --- pyproject.toml | 2 +- src/orb/_base_client.py | 11 +++++++++-- tests/test_client.py | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8db80a9f..866583b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/orbcorp/orb-python" Repository = "https://github.com/orbcorp/orb-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] [tool.rye] managed = true diff --git a/src/orb/_base_client.py b/src/orb/_base_client.py index 0212bd38..30832fc9 100644 --- a/src/orb/_base_client.py +++ b/src/orb/_base_client.py @@ -530,6 +530,15 @@ def _build_request( # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + is_body_allowed = options.method.lower() != "get" + + if is_body_allowed: + kwargs["json"] = json_data if is_given(json_data) else None + kwargs["files"] = files + else: + headers.pop("Content-Type", None) + kwargs.pop("data", None) + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, @@ -541,8 +550,6 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data if is_given(json_data) else None, - files=files, **kwargs, ) diff --git a/tests/test_client.py b/tests/test_client.py index b2a4334b..c9a672f7 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -454,7 +454,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, client: Orb) -> None: request = client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, @@ -1311,7 +1311,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, async_client: AsyncOrb) -> None: request = async_client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, From 53ef83863cf735a0b807396c9ba3a505b7c09565 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:16:42 +0000 Subject: [PATCH 3/3] release: 4.4.2 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ pyproject.toml | 2 +- src/orb/_version.py | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 396d9f01..fa522860 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.4.1" + ".": "4.4.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1023877d..5d3980bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 4.4.2 (2025-07-11) + +Full Changelog: [v4.4.1...v4.4.2](https://github.com/orbcorp/orb-python/compare/v4.4.1...v4.4.2) + +### Bug Fixes + +* **client:** don't send Content-Type header on GET requests ([958c8b9](https://github.com/orbcorp/orb-python/commit/958c8b911c0b66d54e7f384f8fc4a7096a550a44)) + + +### Chores + +* **readme:** fix version rendering on pypi ([ea7d8b3](https://github.com/orbcorp/orb-python/commit/ea7d8b30d3f960def16a2484720df085a87be756)) + ## 4.4.1 (2025-07-09) Full Changelog: [v4.4.0...v4.4.1](https://github.com/orbcorp/orb-python/compare/v4.4.0...v4.4.1) diff --git a/pyproject.toml b/pyproject.toml index 866583b3..8586713f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "4.4.1" +version = "4.4.2" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/_version.py b/src/orb/_version.py index 0c52e5ff..6d411fc2 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.4.1" # x-release-please-version +__version__ = "4.4.2" # x-release-please-version