Skip to content

Commit 2b5baae

Browse files
release: 0.5.0 (#94)
* codegen metadata * chore(internal): codegen related update (#93) * chore(client): simplify `Optional[object]` to just `object` (#95) * chore: add missing isclass check (#96) * chore(internal): bump httpx dependency (#97) * feat(api): api update (#98) * fix(client): only call .close() when needed (#99) * docs: fix typos (#100) * chore(internal): codegen related update (#101) * feat(api): api update (#102) * feat(api): api update (#103) * fix: correctly handle deserialising `cls` fields (#104) * release: 0.5.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent cec1eab commit 2b5baae

26 files changed

+111
-84
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.4.0"
2+
".": "0.5.0"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-54bca763996117c90eb0d297dda154e35be304a72c8744910cb3d81a227bb638.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-fbf471c508c87d8f33abb016566e4a23c1a188f8097af9bab707cd0f13c0663b.yml

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Changelog
22

3+
## 0.5.0 (2025-01-10)
4+
5+
Full Changelog: [v0.4.0...v0.5.0](https://github.com/riza-io/riza-api-python/compare/v0.4.0...v0.5.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#102](https://github.com/riza-io/riza-api-python/issues/102)) ([c8ea4ee](https://github.com/riza-io/riza-api-python/commit/c8ea4ee239378ce5b9da4d09632e92aa6888701b))
10+
* **api:** api update ([#103](https://github.com/riza-io/riza-api-python/issues/103)) ([dd6e86b](https://github.com/riza-io/riza-api-python/commit/dd6e86b17f2be98752d94f957416ceec9869eaed))
11+
* **api:** api update ([#98](https://github.com/riza-io/riza-api-python/issues/98)) ([f7f7d5f](https://github.com/riza-io/riza-api-python/commit/f7f7d5f97e98b6b6ab7c6f83322c76ba732a4ca7))
12+
13+
14+
### Bug Fixes
15+
16+
* **client:** only call .close() when needed ([#99](https://github.com/riza-io/riza-api-python/issues/99)) ([2f1bc2d](https://github.com/riza-io/riza-api-python/commit/2f1bc2d99cc4abf2f1c5dcb37b8c560f466b0eae))
17+
* correctly handle deserialising `cls` fields ([#104](https://github.com/riza-io/riza-api-python/issues/104)) ([3dcd14e](https://github.com/riza-io/riza-api-python/commit/3dcd14ed7378af31b405bdeb882460bbe838364c))
18+
19+
20+
### Chores
21+
22+
* add missing isclass check ([#96](https://github.com/riza-io/riza-api-python/issues/96)) ([eb92ef8](https://github.com/riza-io/riza-api-python/commit/eb92ef8ac93da94d0dd5ce52b985f8732a5dc81f))
23+
* **client:** simplify `Optional[object]` to just `object` ([#95](https://github.com/riza-io/riza-api-python/issues/95)) ([3f86041](https://github.com/riza-io/riza-api-python/commit/3f86041e44d871aeab2f6986d2f1702ddf0a9515))
24+
* **internal:** bump httpx dependency ([#97](https://github.com/riza-io/riza-api-python/issues/97)) ([a68c310](https://github.com/riza-io/riza-api-python/commit/a68c310a4745d94238e5ef8af46fc2f2dbd3e5ab))
25+
* **internal:** codegen related update ([#101](https://github.com/riza-io/riza-api-python/issues/101)) ([cc3e865](https://github.com/riza-io/riza-api-python/commit/cc3e8654246ab7afdd0f887f1de7b25c651e59bd))
26+
* **internal:** codegen related update ([#93](https://github.com/riza-io/riza-api-python/issues/93)) ([f5ad741](https://github.com/riza-io/riza-api-python/commit/f5ad74129fdfc41d5355cba9e0c8f49912cdb0c4))
27+
28+
29+
### Documentation
30+
31+
* fix typos ([#100](https://github.com/riza-io/riza-api-python/issues/100)) ([aa496ac](https://github.com/riza-io/riza-api-python/commit/aa496acaa98ecf9e04acf2e8a1b1160ac18d51bf))
32+
333
## 0.4.0 (2024-12-18)
434

535
Full Changelog: [v0.3.0...v0.4.0](https://github.com/riza-io/riza-api-python/compare/v0.3.0...v0.4.0)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2024 Riza
189+
Copyright 2025 Riza
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ except rizaio.APIStatusError as e:
110110
print(e.response)
111111
```
112112

113-
Error codes are as followed:
113+
Error codes are as follows:
114114

115115
| Status Code | Error Type |
116116
| ----------- | -------------------------- |
@@ -253,8 +253,7 @@ If you need to access undocumented endpoints, params, or response properties, th
253253
#### Undocumented endpoints
254254

255255
To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
256-
http verbs. Options on the client will be respected (such as retries) will be respected when making this
257-
request.
256+
http verbs. Options on the client will be respected (such as retries) when making this request.
258257

259258
```py
260259
import httpx
@@ -326,7 +325,7 @@ with Riza() as client:
326325
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:
327326

328327
1. Changes that only affect static types, without breaking runtime behavior.
329-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
328+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
330329
3. Changes that we do not expect to impact the vast majority of users in practice.
331330

332331
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rizaio"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
description = "The official Python library for the riza API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -54,7 +54,7 @@ dev-dependencies = [
5454
"dirty-equals>=0.6.0",
5555
"importlib-metadata>=6.7.0",
5656
"rich>=13.7.1",
57-
"nest_asyncio==1.6.0"
57+
"nest_asyncio==1.6.0",
5858
]
5959

6060
[tool.rye.scripts]

requirements-dev.lock

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ h11==0.14.0
3535
# via httpcore
3636
httpcore==1.0.2
3737
# via httpx
38-
httpx==0.25.2
38+
httpx==0.28.1
3939
# via respx
4040
# via rizaio
4141
idna==3.4
@@ -76,7 +76,7 @@ python-dateutil==2.8.2
7676
# via time-machine
7777
pytz==2023.3.post1
7878
# via dirty-equals
79-
respx==0.20.2
79+
respx==0.22.0
8080
rich==13.7.1
8181
ruff==0.6.9
8282
setuptools==68.2.2
@@ -85,7 +85,6 @@ six==1.16.0
8585
# via python-dateutil
8686
sniffio==1.3.0
8787
# via anyio
88-
# via httpx
8988
# via rizaio
9089
time-machine==2.9.0
9190
tomli==2.0.2

requirements.lock

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ h11==0.14.0
2525
# via httpcore
2626
httpcore==1.0.2
2727
# via httpx
28-
httpx==0.25.2
28+
httpx==0.28.1
2929
# via rizaio
3030
idna==3.4
3131
# via anyio
@@ -36,7 +36,6 @@ pydantic-core==2.27.1
3636
# via pydantic
3737
sniffio==1.3.0
3838
# via anyio
39-
# via httpx
4039
# via rizaio
4140
typing-extensions==4.12.2
4241
# via anyio

src/rizaio/_base_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,9 @@ def __init__(self, **kwargs: Any) -> None:
767767

768768
class SyncHttpxClientWrapper(DefaultHttpxClient):
769769
def __del__(self) -> None:
770+
if self.is_closed:
771+
return
772+
770773
try:
771774
self.close()
772775
except Exception:
@@ -1334,6 +1337,9 @@ def __init__(self, **kwargs: Any) -> None:
13341337

13351338
class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient):
13361339
def __del__(self) -> None:
1340+
if self.is_closed:
1341+
return
1342+
13371343
try:
13381344
# TODO(someday): support non asyncio runtimes here
13391345
asyncio.get_running_loop().create_task(self.aclose())

src/rizaio/_models.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ def __str__(self) -> str:
179179
@classmethod
180180
@override
181181
def construct( # pyright: ignore[reportIncompatibleMethodOverride]
182-
cls: Type[ModelT],
182+
__cls: Type[ModelT],
183183
_fields_set: set[str] | None = None,
184184
**values: object,
185185
) -> ModelT:
186-
m = cls.__new__(cls)
186+
m = __cls.__new__(__cls)
187187
fields_values: dict[str, object] = {}
188188

189-
config = get_model_config(cls)
189+
config = get_model_config(__cls)
190190
populate_by_name = (
191191
config.allow_population_by_field_name
192192
if isinstance(config, _ConfigProtocol)
@@ -196,7 +196,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride]
196196
if _fields_set is None:
197197
_fields_set = set()
198198

199-
model_fields = get_model_fields(cls)
199+
model_fields = get_model_fields(__cls)
200200
for name, field in model_fields.items():
201201
key = field.alias
202202
if key is None or (key not in values and populate_by_name):
@@ -488,7 +488,11 @@ def construct_type(*, value: object, type_: object) -> object:
488488
_, items_type = get_args(type_) # Dict[_, items_type]
489489
return {key: construct_type(value=item, type_=items_type) for key, item in value.items()}
490490

491-
if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)):
491+
if (
492+
not is_literal_type(type_)
493+
and inspect.isclass(origin)
494+
and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel))
495+
):
492496
if is_list(value):
493497
return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value]
494498

0 commit comments

Comments
 (0)