diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5c0eb511c..35eef82a5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.176.1" + ".": "0.176.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 72eaf7206..2146dd3ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 0.176.2 (2025-01-10) + +Full Changelog: [v0.176.1...v0.176.2](https://github.com/Increase/increase-python/compare/v0.176.1...v0.176.2) + +### Bug Fixes + +* correctly handle deserialising `cls` fields ([#906](https://github.com/Increase/increase-python/issues/906)) ([38c9a6d](https://github.com/Increase/increase-python/commit/38c9a6df14ed001be40456a262a3a82633189bda)) + + +### Chores + +* **internal:** codegen related update ([#905](https://github.com/Increase/increase-python/issues/905)) ([297c7d7](https://github.com/Increase/increase-python/commit/297c7d736a1fe0924b3ff0688d6c9931e0d9dd58)) + + +### Documentation + +* fix typos ([#903](https://github.com/Increase/increase-python/issues/903)) ([260dd28](https://github.com/Increase/increase-python/commit/260dd2814749688c73811b96959b42cc7db859d0)) + ## 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) diff --git a/README.md b/README.md index b628869aa..ad3ccd20a 100644 --- a/README.md +++ b/README.md @@ -209,7 +209,7 @@ except increase.APIStatusError as e: print(e.response) ``` -Error codes are as followed: +Error codes are as follows: | Status Code | Error Type | | ----------- | -------------------------- | @@ -356,8 +356,7 @@ If you need to access undocumented endpoints, params, or response properties, th #### Undocumented endpoints To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other -http verbs. Options on the client will be respected (such as retries) will be respected when making this -request. +http verbs. Options on the client will be respected (such as retries) when making this request. ```py import httpx @@ -429,7 +428,7 @@ with Increase() as client: 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: 1. Changes that only affect static types, without breaking runtime behavior. -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)_. +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.)_ 3. Changes that we do not expect to impact the vast majority of users in practice. We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. diff --git a/pyproject.toml b/pyproject.toml index fb714adfe..816bbebe1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.176.1" +version = "0.176.2" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_models.py b/src/increase/_models.py index d56ea1d9e..9a918aabf 100644 --- a/src/increase/_models.py +++ b/src/increase/_models.py @@ -179,14 +179,14 @@ def __str__(self) -> str: @classmethod @override def construct( # pyright: ignore[reportIncompatibleMethodOverride] - cls: Type[ModelT], + __cls: Type[ModelT], _fields_set: set[str] | None = None, **values: object, ) -> ModelT: - m = cls.__new__(cls) + m = __cls.__new__(__cls) fields_values: dict[str, object] = {} - config = get_model_config(cls) + config = get_model_config(__cls) populate_by_name = ( config.allow_population_by_field_name if isinstance(config, _ConfigProtocol) @@ -196,7 +196,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] if _fields_set is None: _fields_set = set() - model_fields = get_model_fields(cls) + model_fields = get_model_fields(__cls) for name, field in model_fields.items(): key = field.alias if key is None or (key not in values and populate_by_name): diff --git a/src/increase/_version.py b/src/increase/_version.py index 5669ee2c0..7013a656f 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.1" # x-release-please-version +__version__ = "0.176.2" # x-release-please-version diff --git a/tests/test_models.py b/tests/test_models.py index f4a286767..f8e6daff3 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -844,3 +844,13 @@ class Model(BaseModel): assert m.alias == "foo" assert isinstance(m.union, str) assert m.union == "bar" + + +@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +def test_field_named_cls() -> None: + class Model(BaseModel): + cls: str + + m = construct_type(value={"cls": "foo"}, type_=Model) + assert isinstance(m, Model) + assert isinstance(m.cls, str)