diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 864c3f0ed..5c0eb511c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.176.0" + ".": "0.176.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index da7e8d234..72eaf7206 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.176.1 (2025-01-07) + +Full Changelog: [v0.176.0...v0.176.1](https://github.com/Increase/increase-python/compare/v0.176.0...v0.176.1) + +### Bug Fixes + +* **client:** only call .close() when needed ([#901](https://github.com/Increase/increase-python/issues/901)) ([ddb9128](https://github.com/Increase/increase-python/commit/ddb912885847512f44f3e8a6469c74372f444d67)) + + +### Chores + +* add missing isclass check ([#898](https://github.com/Increase/increase-python/issues/898)) ([664358c](https://github.com/Increase/increase-python/commit/664358c615c460abbe5f7b886342cea8dc39748d)) +* **internal:** bump httpx dependency ([#900](https://github.com/Increase/increase-python/issues/900)) ([4922758](https://github.com/Increase/increase-python/commit/4922758971a874d0f4a802241126586bc86bf555)) + ## 0.176.0 (2025-01-02) Full Changelog: [v0.175.0...v0.176.0](https://github.com/Increase/increase-python/compare/v0.175.0...v0.176.0) diff --git a/pyproject.toml b/pyproject.toml index 546e5bc74..fb714adfe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.176.0" +version = "0.176.1" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" @@ -54,7 +54,7 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - "nest_asyncio==1.6.0" + "nest_asyncio==1.6.0", ] [tool.rye.scripts] diff --git a/requirements-dev.lock b/requirements-dev.lock index f93fb910c..9a6b7d897 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -35,7 +35,7 @@ h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx -httpx==0.25.2 +httpx==0.28.1 # via increase # via respx idna==3.4 @@ -76,7 +76,7 @@ python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 # via dirty-equals -respx==0.20.2 +respx==0.22.0 rich==13.7.1 ruff==0.6.9 setuptools==68.2.2 @@ -85,7 +85,6 @@ six==1.16.0 # via python-dateutil sniffio==1.3.0 # via anyio - # via httpx # via increase time-machine==2.9.0 tomli==2.0.2 diff --git a/requirements.lock b/requirements.lock index a1809fbc0..be7bd4584 100644 --- a/requirements.lock +++ b/requirements.lock @@ -25,7 +25,7 @@ h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx -httpx==0.25.2 +httpx==0.28.1 # via increase idna==3.4 # via anyio @@ -36,7 +36,6 @@ pydantic-core==2.27.1 # via pydantic sniffio==1.3.0 # via anyio - # via httpx # via increase typing-extensions==4.12.2 # via anyio diff --git a/src/increase/_base_client.py b/src/increase/_base_client.py index 5d09af06c..40466184d 100644 --- a/src/increase/_base_client.py +++ b/src/increase/_base_client.py @@ -767,6 +767,9 @@ def __init__(self, **kwargs: Any) -> None: class SyncHttpxClientWrapper(DefaultHttpxClient): def __del__(self) -> None: + if self.is_closed: + return + try: self.close() except Exception: @@ -1334,6 +1337,9 @@ def __init__(self, **kwargs: Any) -> None: class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): def __del__(self) -> None: + if self.is_closed: + return + try: # TODO(someday): support non asyncio runtimes here asyncio.get_running_loop().create_task(self.aclose()) diff --git a/src/increase/_models.py b/src/increase/_models.py index 7a547ce5c..d56ea1d9e 100644 --- a/src/increase/_models.py +++ b/src/increase/_models.py @@ -488,7 +488,11 @@ def construct_type(*, value: object, type_: object) -> object: _, items_type = get_args(type_) # Dict[_, items_type] return {key: construct_type(value=item, type_=items_type) for key, item in value.items()} - if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)): + if ( + not is_literal_type(type_) + and inspect.isclass(origin) + and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)) + ): if is_list(value): return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value] diff --git a/src/increase/_version.py b/src/increase/_version.py index 56de4a275..5669ee2c0 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.176.0" # x-release-please-version +__version__ = "0.176.1" # x-release-please-version