From 381d705f5abedb48d6c06a9414d584d7eeb2a437 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 17:40:10 +0000 Subject: [PATCH 1/3] chore(internal): codegen related update (#972) --- src/increase/_utils/_sync.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/increase/_utils/_sync.py b/src/increase/_utils/_sync.py index 8b3aaf2b5..ad7ec71b7 100644 --- a/src/increase/_utils/_sync.py +++ b/src/increase/_utils/_sync.py @@ -7,16 +7,20 @@ from typing import Any, TypeVar, Callable, Awaitable from typing_extensions import ParamSpec +import anyio +import sniffio +import anyio.to_thread + T_Retval = TypeVar("T_Retval") T_ParamSpec = ParamSpec("T_ParamSpec") if sys.version_info >= (3, 9): - to_thread = asyncio.to_thread + _asyncio_to_thread = asyncio.to_thread else: # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread # for Python 3.8 support - async def to_thread( + async def _asyncio_to_thread( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs ) -> Any: """Asynchronously run function *func* in a separate thread. @@ -34,6 +38,17 @@ async def to_thread( return await loop.run_in_executor(None, func_call) +async def to_thread( + func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs +) -> T_Retval: + if sniffio.current_async_library() == "asyncio": + return await _asyncio_to_thread(func, *args, **kwargs) + + return await anyio.to_thread.run_sync( + functools.partial(func, *args, **kwargs), + ) + + # inspired by `asyncer`, https://github.com/tiangolo/asyncer def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ From 6328c5b61634cc45f3e5a00f162649283b098dc1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:34:54 +0000 Subject: [PATCH 2/3] feat(client): allow passing `NotGiven` for body (#974) fix(client): mark some request bodies as optional --- src/increase/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/increase/_base_client.py b/src/increase/_base_client.py index e8ba26a43..978d684f1 100644 --- a/src/increase/_base_client.py +++ b/src/increase/_base_client.py @@ -518,7 +518,7 @@ 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, + json=json_data if is_given(json_data) else None, files=files, **kwargs, ) From 813c8433f450cf7ba7bb115014c307a8d376c775 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:36:27 +0000 Subject: [PATCH 3/3] release: 0.193.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dbf415034..544c9a9f6 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.192.0" + ".": "0.193.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a098f5bc6..68b930420 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 0.193.0 (2025-02-20) + +Full Changelog: [v0.192.0...v0.193.0](https://github.com/Increase/increase-python/compare/v0.192.0...v0.193.0) + +### Features + +* **client:** allow passing `NotGiven` for body ([#974](https://github.com/Increase/increase-python/issues/974)) ([6328c5b](https://github.com/Increase/increase-python/commit/6328c5b61634cc45f3e5a00f162649283b098dc1)) + + +### Bug Fixes + +* **client:** mark some request bodies as optional ([6328c5b](https://github.com/Increase/increase-python/commit/6328c5b61634cc45f3e5a00f162649283b098dc1)) + + +### Chores + +* **internal:** codegen related update ([#972](https://github.com/Increase/increase-python/issues/972)) ([381d705](https://github.com/Increase/increase-python/commit/381d705f5abedb48d6c06a9414d584d7eeb2a437)) + ## 0.192.0 (2025-02-19) Full Changelog: [v0.191.0...v0.192.0](https://github.com/Increase/increase-python/compare/v0.191.0...v0.192.0) diff --git a/pyproject.toml b/pyproject.toml index cdbf87234..59632c900 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.192.0" +version = "0.193.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_version.py b/src/increase/_version.py index 92cf9e26d..3606c1b0e 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.192.0" # x-release-please-version +__version__ = "0.193.0" # x-release-please-version