diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 507912c..cf1dd2b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.42.0" + ".": "1.42.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ae0945..c79c751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 1.42.1 (2024-11-26) + +Full Changelog: [v1.42.0...v1.42.1](https://github.com/julep-ai/python-sdk/compare/v1.42.0...v1.42.1) + +### Chores + +* **internal:** codegen related update ([#175](https://github.com/julep-ai/python-sdk/issues/175)) ([d058571](https://github.com/julep-ai/python-sdk/commit/d058571beb49ea1ea9101ea5b6622fa2b6ea679c)) +* **internal:** fix compat model_dump method when warnings are passed ([#171](https://github.com/julep-ai/python-sdk/issues/171)) ([45fdda6](https://github.com/julep-ai/python-sdk/commit/45fdda6fdca71cbaefc86332dcc73e1a2a173f1a)) + + +### Documentation + +* add info log level to readme ([#173](https://github.com/julep-ai/python-sdk/issues/173)) ([7eb93ee](https://github.com/julep-ai/python-sdk/commit/7eb93eefb33c11f8186962cf20fc2caec3de49d6)) + ## 1.42.0 (2024-11-22) Full Changelog: [v1.41.0...v1.42.0](https://github.com/julep-ai/python-sdk/compare/v1.41.0...v1.42.0) diff --git a/README.md b/README.md index fdbd221..038cb42 100644 --- a/README.md +++ b/README.md @@ -268,12 +268,14 @@ Note that requests that time out are [retried twice by default](#retries). We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module. -You can enable logging by setting the environment variable `JULEP_LOG` to `debug`. +You can enable logging by setting the environment variable `JULEP_LOG` to `info`. ```shell -$ export JULEP_LOG=debug +$ export JULEP_LOG=info ``` +Or to `debug` for more verbose logging. + ### How to tell whether `None` means `null` or missing 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`: diff --git a/pyproject.toml b/pyproject.toml index 5ad0997..5c27ba9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "julep" -version = "1.42.0" +version = "1.42.1" description = "The official Python library for the julep API" dynamic = ["readme"] license = "Apache-2.0" @@ -16,7 +16,6 @@ dependencies = [ "sniffio", "ruamel.yaml>=0.18.6, <0.19", "python-dotenv>=1.0, <1.1", - "cached-property; python_version < '3.8'", ] requires-python = ">= 3.8" classifiers = [ diff --git a/src/julep/_compat.py b/src/julep/_compat.py index 4794129..92d9ee6 100644 --- a/src/julep/_compat.py +++ b/src/julep/_compat.py @@ -145,7 +145,8 @@ def model_dump( exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, - warnings=warnings, + # warnings are not supported in Pydantic v1 + warnings=warnings if PYDANTIC_V2 else True, ) return cast( "dict[str, Any]", @@ -213,9 +214,6 @@ def __set_name__(self, owner: type[Any], name: str) -> None: ... # __set__ is not defined at runtime, but @cached_property is designed to be settable def __set__(self, instance: object, value: _T) -> None: ... else: - try: - from functools import cached_property as cached_property - except ImportError: - from cached_property import cached_property as cached_property + from functools import cached_property as cached_property typed_cached_property = cached_property diff --git a/src/julep/_version.py b/src/julep/_version.py index 61325d9..a258105 100644 --- a/src/julep/_version.py +++ b/src/julep/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "julep" -__version__ = "1.42.0" # x-release-please-version +__version__ = "1.42.1" # x-release-please-version diff --git a/tests/test_models.py b/tests/test_models.py index 8fac397..de16d12 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -561,6 +561,14 @@ class Model(BaseModel): m.model_dump(warnings=False) +def test_compat_method_no_error_for_warnings() -> None: + class Model(BaseModel): + foo: Optional[str] + + m = Model(foo="hello") + assert isinstance(model_dump(m, warnings=False), dict) + + def test_to_json() -> None: class Model(BaseModel): foo: Optional[str] = Field(alias="FOO", default=None)