diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e8fdcd65..caf14871 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.1" + ".": "1.11.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0a6da857..7349bde2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 39 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-c7c3b67aee7f77702be22b17af22bdf799b8c95be8028f20ac406af8b5ec0439.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-2526a31a361274411e6cfc64858b1b084a22ffb491a9490374b717534827b3e1.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 82bb20f5..1dcc948b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 1.11.0 (2024-11-28) + +Full Changelog: [v1.10.1...v1.11.0](https://github.com/Finch-API/finch-api-python/compare/v1.10.1...v1.11.0) + +### Features + +* **api:** api update ([#532](https://github.com/Finch-API/finch-api-python/issues/532)) ([821a77f](https://github.com/Finch-API/finch-api-python/commit/821a77fa1011aa5caa323e451b344f66f36a48eb)) + + +### Bug Fixes + +* **client:** compat with new httpx 0.28.0 release ([#533](https://github.com/Finch-API/finch-api-python/issues/533)) ([f5e151c](https://github.com/Finch-API/finch-api-python/commit/f5e151cb90b0acc31a535a70b9b42ec98000c1e2)) + + +### Chores + +* **internal:** exclude mypy from running on tests ([#531](https://github.com/Finch-API/finch-api-python/issues/531)) ([a5ce0e7](https://github.com/Finch-API/finch-api-python/commit/a5ce0e704b29d58eee8d56174c949557d4cd1b74)) +* remove now unused `cached-property` dep ([#529](https://github.com/Finch-API/finch-api-python/issues/529)) ([7fdf9b7](https://github.com/Finch-API/finch-api-python/commit/7fdf9b7a507cd9c9a4b35f4af60b63d43f63581f)) + ## 1.10.1 (2024-11-23) Full Changelog: [v1.10.0...v1.10.1](https://github.com/Finch-API/finch-api-python/compare/v1.10.0...v1.10.1) diff --git a/mypy.ini b/mypy.ini index 116e626a..9bbce80a 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,7 +5,10 @@ show_error_codes = True # Exclude _files.py because mypy isn't smart enough to apply # the correct type narrowing and as this is an internal module # it's fine to just use Pyright. -exclude = ^(src/finch/_files\.py|_dev/.*\.py)$ +# +# We also exclude our `tests` as mypy doesn't always infer +# types correctly and Pyright will still catch any type errors. +exclude = ^(src/finch/_files\.py|_dev/.*\.py|tests/.*)$ strict_equality = True implicit_reexport = True diff --git a/pyproject.toml b/pyproject.toml index d1aed4ba..50e1c60a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "finch-api" -version = "1.10.1" +version = "1.11.0" description = "The official Python library for the Finch API" dynamic = ["readme"] license = "Apache-2.0" @@ -14,7 +14,6 @@ dependencies = [ "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", - "cached-property; python_version < '3.8'", ] requires-python = ">= 3.8" classifiers = [ diff --git a/src/finch/_base_client.py b/src/finch/_base_client.py index 9f0e0efc..d4625d7c 100644 --- a/src/finch/_base_client.py +++ b/src/finch/_base_client.py @@ -793,6 +793,7 @@ def __init__( custom_query: Mapping[str, object] | None = None, _strict_response_validation: bool, ) -> None: + kwargs: dict[str, Any] = {} if limits is not None: warnings.warn( "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", @@ -805,6 +806,7 @@ def __init__( limits = DEFAULT_CONNECTION_LIMITS if transport is not None: + kwargs["transport"] = transport warnings.warn( "The `transport` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -814,6 +816,7 @@ def __init__( raise ValueError("The `http_client` argument is mutually exclusive with `transport`") if proxies is not None: + kwargs["proxies"] = proxies warnings.warn( "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -857,10 +860,9 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, limits=limits, follow_redirects=True, + **kwargs, # type: ignore ) def is_closed(self) -> bool: @@ -1373,6 +1375,7 @@ def __init__( custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: + kwargs: dict[str, Any] = {} if limits is not None: warnings.warn( "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", @@ -1385,6 +1388,7 @@ def __init__( limits = DEFAULT_CONNECTION_LIMITS if transport is not None: + kwargs["transport"] = transport warnings.warn( "The `transport` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -1394,6 +1398,7 @@ def __init__( raise ValueError("The `http_client` argument is mutually exclusive with `transport`") if proxies is not None: + kwargs["proxies"] = proxies warnings.warn( "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -1437,10 +1442,9 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, limits=limits, follow_redirects=True, + **kwargs, # type: ignore ) def is_closed(self) -> bool: diff --git a/src/finch/_compat.py b/src/finch/_compat.py index df173f85..92d9ee61 100644 --- a/src/finch/_compat.py +++ b/src/finch/_compat.py @@ -214,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/finch/_version.py b/src/finch/_version.py index 2561cdaf..e6a13861 100644 --- a/src/finch/_version.py +++ b/src/finch/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "finch" -__version__ = "1.10.1" # x-release-please-version +__version__ = "1.11.0" # x-release-please-version diff --git a/src/finch/resources/jobs/automated.py b/src/finch/resources/jobs/automated.py index af6b303c..669221d6 100644 --- a/src/finch/resources/jobs/automated.py +++ b/src/finch/resources/jobs/automated.py @@ -67,8 +67,8 @@ def create( progress. Finch allows a fixed window rate limit of 1 forced refresh per hour per connection. - `w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual, - identified by `individual_id`. This feature is currently in beta. + `w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular + individual, identified by `individual_id`. This feature is currently in beta. This endpoint is available for _Scale_ tier customers as an add-on. To request access to this endpoint, please contact your Finch account manager. @@ -91,7 +91,7 @@ def create( self, *, individual_id: str, - type: Literal["w4_data_sync"], + type: Literal["w4_form_employee_sync"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -109,8 +109,8 @@ def create( progress. Finch allows a fixed window rate limit of 1 forced refresh per hour per connection. - `w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual, - identified by `individual_id`. This feature is currently in beta. + `w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular + individual, identified by `individual_id`. This feature is currently in beta. This endpoint is available for _Scale_ tier customers as an add-on. To request access to this endpoint, please contact your Finch account manager. @@ -134,7 +134,7 @@ def create( def create( self, *, - type: Literal["data_sync_all"] | Literal["w4_data_sync"], + type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"], individual_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -284,8 +284,8 @@ async def create( progress. Finch allows a fixed window rate limit of 1 forced refresh per hour per connection. - `w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual, - identified by `individual_id`. This feature is currently in beta. + `w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular + individual, identified by `individual_id`. This feature is currently in beta. This endpoint is available for _Scale_ tier customers as an add-on. To request access to this endpoint, please contact your Finch account manager. @@ -308,7 +308,7 @@ async def create( self, *, individual_id: str, - type: Literal["w4_data_sync"], + type: Literal["w4_form_employee_sync"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -326,8 +326,8 @@ async def create( progress. Finch allows a fixed window rate limit of 1 forced refresh per hour per connection. - `w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual, - identified by `individual_id`. This feature is currently in beta. + `w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular + individual, identified by `individual_id`. This feature is currently in beta. This endpoint is available for _Scale_ tier customers as an add-on. To request access to this endpoint, please contact your Finch account manager. @@ -351,7 +351,7 @@ async def create( async def create( self, *, - type: Literal["data_sync_all"] | Literal["w4_data_sync"], + type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"], individual_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/finch/types/jobs/automated_create_params.py b/src/finch/types/jobs/automated_create_params.py index baa97c11..88b5c9ac 100644 --- a/src/finch/types/jobs/automated_create_params.py +++ b/src/finch/types/jobs/automated_create_params.py @@ -5,7 +5,7 @@ from typing import Union from typing_extensions import Literal, Required, TypeAlias, TypedDict -__all__ = ["AutomatedCreateParams", "DataSyncAll", "W4DataSync"] +__all__ = ["AutomatedCreateParams", "DataSyncAll", "W4FormEmployeeSync"] class DataSyncAll(TypedDict, total=False): @@ -13,12 +13,12 @@ class DataSyncAll(TypedDict, total=False): """The type of job to start.""" -class W4DataSync(TypedDict, total=False): +class W4FormEmployeeSync(TypedDict, total=False): individual_id: Required[str] """The unique ID of the individual for W-4 data sync.""" - type: Required[Literal["w4_data_sync"]] + type: Required[Literal["w4_form_employee_sync"]] """The type of job to start.""" -AutomatedCreateParams: TypeAlias = Union[DataSyncAll, W4DataSync] +AutomatedCreateParams: TypeAlias = Union[DataSyncAll, W4FormEmployeeSync] diff --git a/tests/api_resources/jobs/test_automated.py b/tests/api_resources/jobs/test_automated.py index 2761582d..c7571fa6 100644 --- a/tests/api_resources/jobs/test_automated.py +++ b/tests/api_resources/jobs/test_automated.py @@ -53,7 +53,7 @@ def test_streaming_response_create_overload_1(self, client: Finch) -> None: def test_method_create_overload_2(self, client: Finch) -> None: automated = client.jobs.automated.create( individual_id="individual_id", - type="w4_data_sync", + type="w4_form_employee_sync", ) assert_matches_type(AutomatedCreateResponse, automated, path=["response"]) @@ -61,7 +61,7 @@ def test_method_create_overload_2(self, client: Finch) -> None: def test_raw_response_create_overload_2(self, client: Finch) -> None: response = client.jobs.automated.with_raw_response.create( individual_id="individual_id", - type="w4_data_sync", + type="w4_form_employee_sync", ) assert response.is_closed is True @@ -73,7 +73,7 @@ def test_raw_response_create_overload_2(self, client: Finch) -> None: def test_streaming_response_create_overload_2(self, client: Finch) -> None: with client.jobs.automated.with_streaming_response.create( individual_id="individual_id", - type="w4_data_sync", + type="w4_form_employee_sync", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -193,7 +193,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncFin async def test_method_create_overload_2(self, async_client: AsyncFinch) -> None: automated = await async_client.jobs.automated.create( individual_id="individual_id", - type="w4_data_sync", + type="w4_form_employee_sync", ) assert_matches_type(AutomatedCreateResponse, automated, path=["response"]) @@ -201,7 +201,7 @@ async def test_method_create_overload_2(self, async_client: AsyncFinch) -> None: async def test_raw_response_create_overload_2(self, async_client: AsyncFinch) -> None: response = await async_client.jobs.automated.with_raw_response.create( individual_id="individual_id", - type="w4_data_sync", + type="w4_form_employee_sync", ) assert response.is_closed is True @@ -213,7 +213,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncFinch) -> async def test_streaming_response_create_overload_2(self, async_client: AsyncFinch) -> None: async with async_client.jobs.automated.with_streaming_response.create( individual_id="individual_id", - type="w4_data_sync", + type="w4_form_employee_sync", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"