Skip to content

Commit 0eb8d48

Browse files
release: 0.3.0 (#64)
* chore: rebuild project due to codegen change (#63) * feat(api): api update (#65) * chore: rebuild project due to codegen change (#66) * fix(asyncify): avoid hanging process under certain conditions (#67) * chore(internal): fix compat model_dump method when warnings are passed (#68) * docs: add info log level to readme (#69) * chore: remove now unused `cached-property` dep (#70) * chore(internal): exclude mypy from running on tests (#71) * fix(client): compat with new httpx 0.28.0 release (#72) * feat(api): api update (#73) * chore(internal): bump pyright (#74) * chore: make the `Omit` type public (#75) * release: 0.3.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 212afa5 commit 0eb8d48

22 files changed

+173
-277
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.2.0"
2+
".": "0.3.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: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-6a6ef20cc3e9d270a1ddd031d63f754cfec74c877c184161a7996249a5cffae6.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-9a6cae8060b4218d0c77f439b226c60ee21f22d0ec5846c4ed3f20b5e9543046.yml

CHANGELOG.md

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

3+
## 0.3.0 (2024-12-04)
4+
5+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/riza-io/riza-api-python/compare/v0.2.0...v0.3.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#65](https://github.com/riza-io/riza-api-python/issues/65)) ([eba3a1f](https://github.com/riza-io/riza-api-python/commit/eba3a1f7707ac227cb6aea17fa9a01eaf7a2ceb6))
10+
* **api:** api update ([#73](https://github.com/riza-io/riza-api-python/issues/73)) ([ed2dce2](https://github.com/riza-io/riza-api-python/commit/ed2dce226c51ad686d5ac3f16eb415219f49e3d8))
11+
12+
13+
### Bug Fixes
14+
15+
* **asyncify:** avoid hanging process under certain conditions ([#67](https://github.com/riza-io/riza-api-python/issues/67)) ([21f1add](https://github.com/riza-io/riza-api-python/commit/21f1add3810506b951b26234794e2e9861de746a))
16+
* **client:** compat with new httpx 0.28.0 release ([#72](https://github.com/riza-io/riza-api-python/issues/72)) ([23c7fc1](https://github.com/riza-io/riza-api-python/commit/23c7fc19abd259d6079e21dc4bca7214e5b93eee))
17+
18+
19+
### Chores
20+
21+
* **internal:** bump pyright ([#74](https://github.com/riza-io/riza-api-python/issues/74)) ([cf46ef4](https://github.com/riza-io/riza-api-python/commit/cf46ef43dbfef1afb9abd7187668b276b2b663f8))
22+
* **internal:** exclude mypy from running on tests ([#71](https://github.com/riza-io/riza-api-python/issues/71)) ([eb486dd](https://github.com/riza-io/riza-api-python/commit/eb486dd086c91bf95ed2a6832eee87814520bddb))
23+
* **internal:** fix compat model_dump method when warnings are passed ([#68](https://github.com/riza-io/riza-api-python/issues/68)) ([97dfabe](https://github.com/riza-io/riza-api-python/commit/97dfabe83694b0e25374bb4b092e3d4d9c8aa3d3))
24+
* make the `Omit` type public ([#75](https://github.com/riza-io/riza-api-python/issues/75)) ([fb119ae](https://github.com/riza-io/riza-api-python/commit/fb119aee18caca678e0d9b9ef0cb9d87e825e04c))
25+
* rebuild project due to codegen change ([#63](https://github.com/riza-io/riza-api-python/issues/63)) ([ddd46bc](https://github.com/riza-io/riza-api-python/commit/ddd46bc6dfb9e423aacc494b6a2a2205800d6ac5))
26+
* rebuild project due to codegen change ([#66](https://github.com/riza-io/riza-api-python/issues/66)) ([d9dc13d](https://github.com/riza-io/riza-api-python/commit/d9dc13d8e1f112c70ece5466346d3e0dfabe6a75))
27+
* remove now unused `cached-property` dep ([#70](https://github.com/riza-io/riza-api-python/issues/70)) ([767194b](https://github.com/riza-io/riza-api-python/commit/767194b1bf69905470c1d949118471f3fbca2934))
28+
29+
30+
### Documentation
31+
32+
* add info log level to readme ([#69](https://github.com/riza-io/riza-api-python/issues/69)) ([0b9f395](https://github.com/riza-io/riza-api-python/commit/0b9f39590eb72bf13f56643f58a4b4059d2dbdd8))
33+
334
## 0.2.0 (2024-11-07)
435

536
Full Changelog: [v0.1.1...v0.2.0](https://github.com/riza-io/riza-api-python/compare/v0.1.1...v0.2.0)

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ import os
2828
from rizaio import Riza
2929

3030
client = Riza(
31-
# This is the default and can be omitted
32-
api_key=os.environ.get("RIZA_API_KEY"),
31+
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
3332
)
3433

3534
response = client.command.exec(
@@ -54,8 +53,7 @@ import asyncio
5453
from rizaio import AsyncRiza
5554

5655
client = AsyncRiza(
57-
# This is the default and can be omitted
58-
api_key=os.environ.get("RIZA_API_KEY"),
56+
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
5957
)
6058

6159

@@ -185,12 +183,14 @@ Note that requests that time out are [retried twice by default](#retries).
185183

186184
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
187185

188-
You can enable logging by setting the environment variable `RIZA_LOG` to `debug`.
186+
You can enable logging by setting the environment variable `RIZA_LOG` to `info`.
189187

190188
```shell
191-
$ export RIZA_LOG=debug
189+
$ export RIZA_LOG=info
192190
```
193191

192+
Or to `debug` for more verbose logging.
193+
194194
### How to tell whether `None` means `null` or missing
195195

196196
In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:

mypy.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ show_error_codes = True
55
# Exclude _files.py because mypy isn't smart enough to apply
66
# the correct type narrowing and as this is an internal module
77
# it's fine to just use Pyright.
8-
exclude = ^(src/rizaio/_files\.py|_dev/.*\.py)$
8+
#
9+
# We also exclude our `tests` as mypy doesn't always infer
10+
# types correctly and Pyright will still catch any type errors.
11+
exclude = ^(src/rizaio/_files\.py|_dev/.*\.py|tests/.*)$
912

1013
strict_equality = True
1114
implicit_reexport = True

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.2.0"
3+
version = "0.3.0"
44
description = "The official Python library for the riza API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -14,7 +14,6 @@ dependencies = [
1414
"anyio>=3.5.0, <5",
1515
"distro>=1.7.0, <2",
1616
"sniffio",
17-
"cached-property; python_version < '3.8'",
1817
]
1918
requires-python = ">= 3.8"
2019
classifiers = [
@@ -55,6 +54,7 @@ dev-dependencies = [
5554
"dirty-equals>=0.6.0",
5655
"importlib-metadata>=6.7.0",
5756
"rich>=13.7.1",
57+
"nest_asyncio==1.6.0"
5858
]
5959

6060
[tool.rye.scripts]

requirements-dev.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ mdurl==0.1.2
5151
mypy==1.13.0
5252
mypy-extensions==1.0.0
5353
# via mypy
54+
nest-asyncio==1.6.0
5455
nodeenv==1.8.0
5556
# via pyright
5657
nox==2023.4.22
@@ -67,7 +68,7 @@ pydantic-core==2.23.4
6768
# via pydantic
6869
pygments==2.18.0
6970
# via rich
70-
pyright==1.1.380
71+
pyright==1.1.389
7172
pytest==8.3.3
7273
# via pytest-asyncio
7374
pytest-asyncio==0.24.0
@@ -95,6 +96,7 @@ typing-extensions==4.12.2
9596
# via mypy
9697
# via pydantic
9798
# via pydantic-core
99+
# via pyright
98100
# via rizaio
99101
virtualenv==20.24.5
100102
# via nox

src/rizaio/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from . import types
4-
from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes
4+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
55
from ._utils import file_from_path
66
from ._client import Riza, Client, Stream, Timeout, AsyncRiza, Transport, AsyncClient, AsyncStream, RequestOptions
77
from ._models import BaseModel
@@ -36,6 +36,7 @@
3636
"ProxiesTypes",
3737
"NotGiven",
3838
"NOT_GIVEN",
39+
"Omit",
3940
"RizaError",
4041
"APIError",
4142
"APIStatusError",

src/rizaio/_base_client.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ def __init__(
792792
custom_query: Mapping[str, object] | None = None,
793793
_strict_response_validation: bool,
794794
) -> None:
795+
kwargs: dict[str, Any] = {}
795796
if limits is not None:
796797
warnings.warn(
797798
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -804,6 +805,7 @@ def __init__(
804805
limits = DEFAULT_CONNECTION_LIMITS
805806

806807
if transport is not None:
808+
kwargs["transport"] = transport
807809
warnings.warn(
808810
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
809811
category=DeprecationWarning,
@@ -813,6 +815,7 @@ def __init__(
813815
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
814816

815817
if proxies is not None:
818+
kwargs["proxies"] = proxies
816819
warnings.warn(
817820
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
818821
category=DeprecationWarning,
@@ -856,10 +859,9 @@ def __init__(
856859
base_url=base_url,
857860
# cast to a valid type because mypy doesn't understand our type narrowing
858861
timeout=cast(Timeout, timeout),
859-
proxies=proxies,
860-
transport=transport,
861862
limits=limits,
862863
follow_redirects=True,
864+
**kwargs, # type: ignore
863865
)
864866

865867
def is_closed(self) -> bool:
@@ -1358,6 +1360,7 @@ def __init__(
13581360
custom_headers: Mapping[str, str] | None = None,
13591361
custom_query: Mapping[str, object] | None = None,
13601362
) -> None:
1363+
kwargs: dict[str, Any] = {}
13611364
if limits is not None:
13621365
warnings.warn(
13631366
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -1370,6 +1373,7 @@ def __init__(
13701373
limits = DEFAULT_CONNECTION_LIMITS
13711374

13721375
if transport is not None:
1376+
kwargs["transport"] = transport
13731377
warnings.warn(
13741378
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
13751379
category=DeprecationWarning,
@@ -1379,6 +1383,7 @@ def __init__(
13791383
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
13801384

13811385
if proxies is not None:
1386+
kwargs["proxies"] = proxies
13821387
warnings.warn(
13831388
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
13841389
category=DeprecationWarning,
@@ -1422,10 +1427,9 @@ def __init__(
14221427
base_url=base_url,
14231428
# cast to a valid type because mypy doesn't understand our type narrowing
14241429
timeout=cast(Timeout, timeout),
1425-
proxies=proxies,
1426-
transport=transport,
14271430
limits=limits,
14281431
follow_redirects=True,
1432+
**kwargs, # type: ignore
14291433
)
14301434

14311435
def is_closed(self) -> bool:

src/rizaio/_compat.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ def model_dump(
145145
exclude=exclude,
146146
exclude_unset=exclude_unset,
147147
exclude_defaults=exclude_defaults,
148-
warnings=warnings,
148+
# warnings are not supported in Pydantic v1
149+
warnings=warnings if PYDANTIC_V2 else True,
149150
)
150151
return cast(
151152
"dict[str, Any]",
@@ -213,9 +214,6 @@ def __set_name__(self, owner: type[Any], name: str) -> None: ...
213214
# __set__ is not defined at runtime, but @cached_property is designed to be settable
214215
def __set__(self, instance: object, value: _T) -> None: ...
215216
else:
216-
try:
217-
from functools import cached_property as cached_property
218-
except ImportError:
219-
from cached_property import cached_property as cached_property
217+
from functools import cached_property as cached_property
220218

221219
typed_cached_property = cached_property

0 commit comments

Comments
 (0)