From 66bdbbd19d3c27f58471b23417f4ee398ae93988 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Thu, 7 Dec 2023 10:09:11 +0000 Subject: [PATCH] chore(internal): reformat imports --- pyproject.toml | 37 ++++----- requirements-dev.lock | 3 +- src/finch/_client.py | 3 +- src/finch/_compat.py | 30 ++++---- src/finch/_models.py | 14 +--- src/finch/_types.py | 9 +-- src/finch/_utils/__init__.py | 76 ++++++++++--------- src/finch/_utils/_utils.py | 4 +- src/finch/resources/__init__.py | 14 +--- src/finch/resources/account.py | 12 ++- src/finch/resources/hris/__init__.py | 35 ++------- src/finch/resources/hris/benefits/__init__.py | 14 +--- src/finch/resources/hris/benefits/benefits.py | 20 +++-- .../resources/hris/benefits/individuals.py | 13 +++- src/finch/resources/hris/company.py | 12 ++- src/finch/resources/hris/directory.py | 18 ++++- src/finch/resources/hris/employments.py | 13 +++- src/finch/resources/hris/hris.py | 35 ++------- src/finch/resources/hris/individuals.py | 13 +++- src/finch/resources/hris/pay_statements.py | 13 +++- src/finch/resources/hris/payments.py | 13 +++- src/finch/resources/jobs/__init__.py | 14 +--- src/finch/resources/jobs/automated.py | 13 +++- src/finch/resources/jobs/jobs.py | 14 +--- src/finch/resources/jobs/manual.py | 12 ++- src/finch/resources/providers.py | 13 +++- src/finch/resources/request_forwarding.py | 17 ++++- src/finch/resources/webhooks.py | 8 +- src/finch/types/__init__.py | 8 +- src/finch/types/hris/__init__.py | 32 ++------ src/finch/types/hris/benefits/__init__.py | 12 +-- src/finch/types/hris/benfit_contribution.py | 2 + src/finch/types/jobs/__init__.py | 4 +- tests/utils.py | 7 +- 34 files changed, 280 insertions(+), 277 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b831f420..59fcb8e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,16 +46,16 @@ Repository = "https://github.com/Finch-API/finch-api-python" [tool.rye] managed = true dev-dependencies = [ - "pyright==1.1.332", - "mypy==1.7.1", - "black==23.3.0", - "respx==0.20.2", - "pytest==7.1.1", - "pytest-asyncio==0.21.1", - "ruff==0.0.282", - "isort==5.10.1", - "time-machine==2.9.0", - "nox==2023.4.22", + # version pins are in requirements-dev.lock + "pyright", + "mypy", + "black", + "respx", + "pytest", + "pytest-asyncio", + "ruff", + "time-machine", + "nox", "dirty-equals>=0.6.0", ] @@ -65,12 +65,10 @@ format = { chain = [ "format:black", "format:docs", "format:ruff", - "format:isort", ]} "format:black" = "black ." "format:docs" = "python bin/blacken-docs.py README.md api.md" "format:ruff" = "ruff --fix ." -"format:isort" = "isort ." "check:ruff" = "ruff ." @@ -125,16 +123,13 @@ reportImplicitOverride = true reportImportCycles = false reportPrivateUsage = false -[tool.isort] -profile = "black" -length_sort = true -extra_standard_library = ["typing_extensions"] - [tool.ruff] line-length = 120 -format = "grouped" +output-format = "grouped" target-version = "py37" select = [ + # isort + "I", # remove unused imports "F401", # bare except statements @@ -152,6 +147,12 @@ unfixable = [ ] ignore-init-module-imports = true +[tool.ruff.lint.isort] +length-sort = true +length-sort-straight = true +combine-as-imports = true +extra-standard-library = ["typing_extensions"] +known-first-party = ["finch", "tests"] [tool.ruff.per-file-ignores] "bin/**.py" = ["T201", "T203"] diff --git a/requirements-dev.lock b/requirements-dev.lock index ce154682..36843262 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -25,7 +25,6 @@ httpcore==1.0.2 httpx==0.25.2 idna==3.4 iniconfig==2.0.0 -isort==5.10.1 mypy==1.7.1 mypy-extensions==1.0.0 nodeenv==1.8.0 @@ -43,7 +42,7 @@ pytest-asyncio==0.21.1 python-dateutil==2.8.2 pytz==2023.3.post1 respx==0.20.2 -ruff==0.0.282 +ruff==0.1.7 six==1.16.0 sniffio==1.3.0 time-machine==2.9.0 diff --git a/src/finch/_client.py b/src/finch/_client.py index 149406a0..01252f1f 100644 --- a/src/finch/_client.py +++ b/src/finch/_client.py @@ -24,8 +24,7 @@ ) from ._utils import is_given, get_async_library from ._version import __version__ -from ._streaming import Stream as Stream -from ._streaming import AsyncStream as AsyncStream +from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import APIStatusError from ._base_client import ( DEFAULT_LIMITS, diff --git a/src/finch/_compat.py b/src/finch/_compat.py index 34323c9b..d95db8ed 100644 --- a/src/finch/_compat.py +++ b/src/finch/_compat.py @@ -43,21 +43,23 @@ def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001 else: if PYDANTIC_V2: - from pydantic.v1.typing import get_args as get_args - from pydantic.v1.typing import is_union as is_union - from pydantic.v1.typing import get_origin as get_origin - from pydantic.v1.typing import is_typeddict as is_typeddict - from pydantic.v1.typing import is_literal_type as is_literal_type - from pydantic.v1.datetime_parse import parse_date as parse_date - from pydantic.v1.datetime_parse import parse_datetime as parse_datetime + from pydantic.v1.typing import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, + ) + from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime else: - from pydantic.typing import get_args as get_args - from pydantic.typing import is_union as is_union - from pydantic.typing import get_origin as get_origin - from pydantic.typing import is_typeddict as is_typeddict - from pydantic.typing import is_literal_type as is_literal_type - from pydantic.datetime_parse import parse_date as parse_date - from pydantic.datetime_parse import parse_datetime as parse_datetime + from pydantic.typing import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, + ) + from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime # refactored config diff --git a/src/finch/_models.py b/src/finch/_models.py index 5b8c9601..cdd44ccb 100644 --- a/src/finch/_models.py +++ b/src/finch/_models.py @@ -30,17 +30,11 @@ AnyMapping, HttpxRequestFiles, ) -from ._utils import ( - is_list, - is_given, - is_mapping, - parse_date, - parse_datetime, - strip_not_given, -) -from ._compat import PYDANTIC_V2, ConfigDict -from ._compat import GenericModel as BaseGenericModel +from ._utils import is_list, is_given, is_mapping, parse_date, parse_datetime, strip_not_given from ._compat import ( + PYDANTIC_V2, + ConfigDict, + GenericModel as BaseGenericModel, get_args, is_union, parse_obj, diff --git a/src/finch/_types.py b/src/finch/_types.py index e12f064d..7f82cf4a 100644 --- a/src/finch/_types.py +++ b/src/finch/_types.py @@ -19,14 +19,7 @@ Sequence, AsyncIterator, ) -from typing_extensions import ( - Literal, - Protocol, - TypeAlias, - TypedDict, - override, - runtime_checkable, -) +from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable import pydantic from httpx import URL, Proxy, Timeout, Response, BaseTransport, AsyncBaseTransport diff --git a/src/finch/_utils/__init__.py b/src/finch/_utils/__init__.py index 400ca9b8..e98636c9 100644 --- a/src/finch/_utils/__init__.py +++ b/src/finch/_utils/__init__.py @@ -1,37 +1,41 @@ from ._proxy import LazyProxy as LazyProxy -from ._utils import flatten as flatten -from ._utils import is_dict as is_dict -from ._utils import is_list as is_list -from ._utils import is_given as is_given -from ._utils import is_tuple as is_tuple -from ._utils import is_mapping as is_mapping -from ._utils import is_tuple_t as is_tuple_t -from ._utils import parse_date as parse_date -from ._utils import is_sequence as is_sequence -from ._utils import coerce_float as coerce_float -from ._utils import is_list_type as is_list_type -from ._utils import is_mapping_t as is_mapping_t -from ._utils import removeprefix as removeprefix -from ._utils import removesuffix as removesuffix -from ._utils import extract_files as extract_files -from ._utils import is_sequence_t as is_sequence_t -from ._utils import is_union_type as is_union_type -from ._utils import required_args as required_args -from ._utils import coerce_boolean as coerce_boolean -from ._utils import coerce_integer as coerce_integer -from ._utils import file_from_path as file_from_path -from ._utils import parse_datetime as parse_datetime -from ._utils import strip_not_given as strip_not_given -from ._utils import deepcopy_minimal as deepcopy_minimal -from ._utils import extract_type_arg as extract_type_arg -from ._utils import is_required_type as is_required_type -from ._utils import get_async_library as get_async_library -from ._utils import is_annotated_type as is_annotated_type -from ._utils import maybe_coerce_float as maybe_coerce_float -from ._utils import get_required_header as get_required_header -from ._utils import maybe_coerce_boolean as maybe_coerce_boolean -from ._utils import maybe_coerce_integer as maybe_coerce_integer -from ._utils import strip_annotated_type as strip_annotated_type -from ._transform import PropertyInfo as PropertyInfo -from ._transform import transform as transform -from ._transform import maybe_transform as maybe_transform +from ._utils import ( + flatten as flatten, + is_dict as is_dict, + is_list as is_list, + is_given as is_given, + is_tuple as is_tuple, + is_mapping as is_mapping, + is_tuple_t as is_tuple_t, + parse_date as parse_date, + is_sequence as is_sequence, + coerce_float as coerce_float, + is_list_type as is_list_type, + is_mapping_t as is_mapping_t, + removeprefix as removeprefix, + removesuffix as removesuffix, + extract_files as extract_files, + is_sequence_t as is_sequence_t, + is_union_type as is_union_type, + required_args as required_args, + coerce_boolean as coerce_boolean, + coerce_integer as coerce_integer, + file_from_path as file_from_path, + parse_datetime as parse_datetime, + strip_not_given as strip_not_given, + deepcopy_minimal as deepcopy_minimal, + extract_type_arg as extract_type_arg, + is_required_type as is_required_type, + get_async_library as get_async_library, + is_annotated_type as is_annotated_type, + maybe_coerce_float as maybe_coerce_float, + get_required_header as get_required_header, + maybe_coerce_boolean as maybe_coerce_boolean, + maybe_coerce_integer as maybe_coerce_integer, + strip_annotated_type as strip_annotated_type, +) +from ._transform import ( + PropertyInfo as PropertyInfo, + transform as transform, + maybe_transform as maybe_transform, +) diff --git a/src/finch/_utils/_utils.py b/src/finch/_utils/_utils.py index 83f88cc3..cce69238 100644 --- a/src/finch/_utils/_utils.py +++ b/src/finch/_utils/_utils.py @@ -21,9 +21,7 @@ import sniffio from .._types import Headers, NotGiven, FileTypes, NotGivenOr, HeadersLike -from .._compat import is_union as _is_union -from .._compat import parse_date as parse_date -from .._compat import parse_datetime as parse_datetime +from .._compat import is_union as _is_union, parse_date as parse_date, parse_datetime as parse_datetime _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) diff --git a/src/finch/resources/__init__.py b/src/finch/resources/__init__.py index dcab5333..32d0cf28 100644 --- a/src/finch/resources/__init__.py +++ b/src/finch/resources/__init__.py @@ -2,19 +2,9 @@ from .hris import HRIS, AsyncHRIS, HRISWithRawResponse, AsyncHRISWithRawResponse from .jobs import Jobs, AsyncJobs, JobsWithRawResponse, AsyncJobsWithRawResponse -from .account import ( - Account, - AsyncAccount, - AccountWithRawResponse, - AsyncAccountWithRawResponse, -) +from .account import Account, AsyncAccount, AccountWithRawResponse, AsyncAccountWithRawResponse from .webhooks import Webhooks, AsyncWebhooks -from .providers import ( - Providers, - AsyncProviders, - ProvidersWithRawResponse, - AsyncProvidersWithRawResponse, -) +from .providers import Providers, AsyncProviders, ProvidersWithRawResponse, AsyncProvidersWithRawResponse from .request_forwarding import ( RequestForwarding, AsyncRequestForwarding, diff --git a/src/finch/resources/account.py b/src/finch/resources/account.py index 5d90dfdc..0cb7b3aa 100644 --- a/src/finch/resources/account.py +++ b/src/finch/resources/account.py @@ -7,10 +7,18 @@ import httpx from ..types import Introspection, DisconnectResponse -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper -from .._base_client import make_request_options +from .._base_client import ( + make_request_options, +) if TYPE_CHECKING: from .._client import Finch, AsyncFinch diff --git a/src/finch/resources/hris/__init__.py b/src/finch/resources/hris/__init__.py index 4659abb9..8f292e8f 100644 --- a/src/finch/resources/hris/__init__.py +++ b/src/finch/resources/hris/__init__.py @@ -7,36 +7,11 @@ CompanyResourceWithRawResponse, AsyncCompanyResourceWithRawResponse, ) -from .benefits import ( - Benefits, - AsyncBenefits, - BenefitsWithRawResponse, - AsyncBenefitsWithRawResponse, -) -from .payments import ( - Payments, - AsyncPayments, - PaymentsWithRawResponse, - AsyncPaymentsWithRawResponse, -) -from .directory import ( - Directory, - AsyncDirectory, - DirectoryWithRawResponse, - AsyncDirectoryWithRawResponse, -) -from .employments import ( - Employments, - AsyncEmployments, - EmploymentsWithRawResponse, - AsyncEmploymentsWithRawResponse, -) -from .individuals import ( - Individuals, - AsyncIndividuals, - IndividualsWithRawResponse, - AsyncIndividualsWithRawResponse, -) +from .benefits import Benefits, AsyncBenefits, BenefitsWithRawResponse, AsyncBenefitsWithRawResponse +from .payments import Payments, AsyncPayments, PaymentsWithRawResponse, AsyncPaymentsWithRawResponse +from .directory import Directory, AsyncDirectory, DirectoryWithRawResponse, AsyncDirectoryWithRawResponse +from .employments import Employments, AsyncEmployments, EmploymentsWithRawResponse, AsyncEmploymentsWithRawResponse +from .individuals import Individuals, AsyncIndividuals, IndividualsWithRawResponse, AsyncIndividualsWithRawResponse from .pay_statements import ( PayStatements, AsyncPayStatements, diff --git a/src/finch/resources/hris/benefits/__init__.py b/src/finch/resources/hris/benefits/__init__.py index fbbe99ea..9a5b9063 100644 --- a/src/finch/resources/hris/benefits/__init__.py +++ b/src/finch/resources/hris/benefits/__init__.py @@ -1,17 +1,7 @@ # File generated from our OpenAPI spec by Stainless. -from .benefits import ( - Benefits, - AsyncBenefits, - BenefitsWithRawResponse, - AsyncBenefitsWithRawResponse, -) -from .individuals import ( - Individuals, - AsyncIndividuals, - IndividualsWithRawResponse, - AsyncIndividualsWithRawResponse, -) +from .benefits import Benefits, AsyncBenefits, BenefitsWithRawResponse, AsyncBenefitsWithRawResponse +from .individuals import Individuals, AsyncIndividuals, IndividualsWithRawResponse, AsyncIndividualsWithRawResponse __all__ = [ "Individuals", diff --git a/src/finch/resources/hris/benefits/benefits.py b/src/finch/resources/hris/benefits/benefits.py index f90a5100..4752a838 100644 --- a/src/finch/resources/hris/benefits/benefits.py +++ b/src/finch/resources/hris/benefits/benefits.py @@ -6,14 +6,15 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from .individuals import ( - Individuals, - AsyncIndividuals, - IndividualsWithRawResponse, - AsyncIndividualsWithRawResponse, +from ...._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, ) +from ...._utils import maybe_transform +from .individuals import Individuals, AsyncIndividuals, IndividualsWithRawResponse, AsyncIndividualsWithRawResponse from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ....pagination import SyncSinglePage, AsyncSinglePage @@ -27,7 +28,10 @@ benefit_create_params, benefit_update_params, ) -from ...._base_client import AsyncPaginator, make_request_options +from ...._base_client import ( + AsyncPaginator, + make_request_options, +) if TYPE_CHECKING: from ...._client import Finch, AsyncFinch diff --git a/src/finch/resources/hris/benefits/individuals.py b/src/finch/resources/hris/benefits/individuals.py index fb4b3450..cb09ddf4 100644 --- a/src/finch/resources/hris/benefits/individuals.py +++ b/src/finch/resources/hris/benefits/individuals.py @@ -6,12 +6,21 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from ...._utils import maybe_transform from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ....pagination import SyncSinglePage, AsyncSinglePage -from ...._base_client import AsyncPaginator, make_request_options +from ...._base_client import ( + AsyncPaginator, + make_request_options, +) from ....types.hris.benefits import ( IndividualBenefit, EnrolledIndividual, diff --git a/src/finch/resources/hris/company.py b/src/finch/resources/hris/company.py index af6d6441..3ee67da7 100644 --- a/src/finch/resources/hris/company.py +++ b/src/finch/resources/hris/company.py @@ -6,11 +6,19 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ...types.hris import Company -from ..._base_client import make_request_options +from ..._base_client import ( + make_request_options, +) if TYPE_CHECKING: from ..._client import Finch, AsyncFinch diff --git a/src/finch/resources/hris/directory.py b/src/finch/resources/hris/directory.py index ff3950aa..221586f6 100644 --- a/src/finch/resources/hris/directory.py +++ b/src/finch/resources/hris/directory.py @@ -7,13 +7,25 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from ..._utils import maybe_transform from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ...pagination import SyncIndividualsPage, AsyncIndividualsPage -from ...types.hris import IndividualInDirectory, directory_list_params -from ..._base_client import AsyncPaginator, make_request_options +from ...types.hris import ( + IndividualInDirectory, + directory_list_params, +) +from ..._base_client import ( + AsyncPaginator, + make_request_options, +) if TYPE_CHECKING: from ..._client import Finch, AsyncFinch diff --git a/src/finch/resources/hris/employments.py b/src/finch/resources/hris/employments.py index 0b16202e..c0bd79ba 100644 --- a/src/finch/resources/hris/employments.py +++ b/src/finch/resources/hris/employments.py @@ -6,13 +6,22 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from ..._utils import maybe_transform from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ...pagination import SyncResponsesPage, AsyncResponsesPage from ...types.hris import EmploymentDataResponse, employment_retrieve_many_params -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import ( + AsyncPaginator, + make_request_options, +) if TYPE_CHECKING: from ..._client import Finch, AsyncFinch diff --git a/src/finch/resources/hris/hris.py b/src/finch/resources/hris/hris.py index 8cd4f554..0ba66160 100644 --- a/src/finch/resources/hris/hris.py +++ b/src/finch/resources/hris/hris.py @@ -10,37 +10,12 @@ CompanyResourceWithRawResponse, AsyncCompanyResourceWithRawResponse, ) -from .benefits import ( - Benefits, - AsyncBenefits, - BenefitsWithRawResponse, - AsyncBenefitsWithRawResponse, -) -from .payments import ( - Payments, - AsyncPayments, - PaymentsWithRawResponse, - AsyncPaymentsWithRawResponse, -) -from .directory import ( - Directory, - AsyncDirectory, - DirectoryWithRawResponse, - AsyncDirectoryWithRawResponse, -) +from .benefits import Benefits, AsyncBenefits, BenefitsWithRawResponse, AsyncBenefitsWithRawResponse +from .payments import Payments, AsyncPayments, PaymentsWithRawResponse, AsyncPaymentsWithRawResponse +from .directory import Directory, AsyncDirectory, DirectoryWithRawResponse, AsyncDirectoryWithRawResponse from ..._resource import SyncAPIResource, AsyncAPIResource -from .employments import ( - Employments, - AsyncEmployments, - EmploymentsWithRawResponse, - AsyncEmploymentsWithRawResponse, -) -from .individuals import ( - Individuals, - AsyncIndividuals, - IndividualsWithRawResponse, - AsyncIndividualsWithRawResponse, -) +from .employments import Employments, AsyncEmployments, EmploymentsWithRawResponse, AsyncEmploymentsWithRawResponse +from .individuals import Individuals, AsyncIndividuals, IndividualsWithRawResponse, AsyncIndividualsWithRawResponse from .pay_statements import ( PayStatements, AsyncPayStatements, diff --git a/src/finch/resources/hris/individuals.py b/src/finch/resources/hris/individuals.py index 892eb820..8ca24125 100644 --- a/src/finch/resources/hris/individuals.py +++ b/src/finch/resources/hris/individuals.py @@ -6,13 +6,22 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from ..._utils import maybe_transform from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ...pagination import SyncResponsesPage, AsyncResponsesPage from ...types.hris import IndividualResponse, individual_retrieve_many_params -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import ( + AsyncPaginator, + make_request_options, +) if TYPE_CHECKING: from ..._client import Finch, AsyncFinch diff --git a/src/finch/resources/hris/pay_statements.py b/src/finch/resources/hris/pay_statements.py index 4c444e9b..6ad4be76 100644 --- a/src/finch/resources/hris/pay_statements.py +++ b/src/finch/resources/hris/pay_statements.py @@ -6,13 +6,22 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from ..._utils import maybe_transform from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ...pagination import SyncResponsesPage, AsyncResponsesPage from ...types.hris import PayStatementResponse, pay_statement_retrieve_many_params -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import ( + AsyncPaginator, + make_request_options, +) if TYPE_CHECKING: from ..._client import Finch, AsyncFinch diff --git a/src/finch/resources/hris/payments.py b/src/finch/resources/hris/payments.py index 17364d80..d5d0b28d 100644 --- a/src/finch/resources/hris/payments.py +++ b/src/finch/resources/hris/payments.py @@ -7,13 +7,22 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from ..._utils import maybe_transform from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ...pagination import SyncSinglePage, AsyncSinglePage from ...types.hris import Payment, payment_list_params -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import ( + AsyncPaginator, + make_request_options, +) if TYPE_CHECKING: from ..._client import Finch, AsyncFinch diff --git a/src/finch/resources/jobs/__init__.py b/src/finch/resources/jobs/__init__.py index f1f7692d..112d3130 100644 --- a/src/finch/resources/jobs/__init__.py +++ b/src/finch/resources/jobs/__init__.py @@ -1,18 +1,8 @@ # File generated from our OpenAPI spec by Stainless. from .jobs import Jobs, AsyncJobs, JobsWithRawResponse, AsyncJobsWithRawResponse -from .manual import ( - Manual, - AsyncManual, - ManualWithRawResponse, - AsyncManualWithRawResponse, -) -from .automated import ( - Automated, - AsyncAutomated, - AutomatedWithRawResponse, - AsyncAutomatedWithRawResponse, -) +from .manual import Manual, AsyncManual, ManualWithRawResponse, AsyncManualWithRawResponse +from .automated import Automated, AsyncAutomated, AutomatedWithRawResponse, AsyncAutomatedWithRawResponse __all__ = [ "Automated", diff --git a/src/finch/resources/jobs/automated.py b/src/finch/resources/jobs/automated.py index 9f43c60a..48f2199b 100644 --- a/src/finch/resources/jobs/automated.py +++ b/src/finch/resources/jobs/automated.py @@ -7,7 +7,13 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from ..._utils import maybe_transform from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper @@ -18,7 +24,10 @@ automated_list_params, automated_create_params, ) -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import ( + AsyncPaginator, + make_request_options, +) if TYPE_CHECKING: from ..._client import Finch, AsyncFinch diff --git a/src/finch/resources/jobs/jobs.py b/src/finch/resources/jobs/jobs.py index f522c9c5..a47c4ddd 100644 --- a/src/finch/resources/jobs/jobs.py +++ b/src/finch/resources/jobs/jobs.py @@ -4,18 +4,8 @@ from typing import TYPE_CHECKING -from .manual import ( - Manual, - AsyncManual, - ManualWithRawResponse, - AsyncManualWithRawResponse, -) -from .automated import ( - Automated, - AsyncAutomated, - AutomatedWithRawResponse, - AsyncAutomatedWithRawResponse, -) +from .manual import Manual, AsyncManual, ManualWithRawResponse, AsyncManualWithRawResponse +from .automated import Automated, AsyncAutomated, AutomatedWithRawResponse, AsyncAutomatedWithRawResponse from ..._resource import SyncAPIResource, AsyncAPIResource if TYPE_CHECKING: diff --git a/src/finch/resources/jobs/manual.py b/src/finch/resources/jobs/manual.py index 9334f2da..61f16619 100644 --- a/src/finch/resources/jobs/manual.py +++ b/src/finch/resources/jobs/manual.py @@ -6,11 +6,19 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ...types.jobs import ManualAsyncJob -from ..._base_client import make_request_options +from ..._base_client import ( + make_request_options, +) if TYPE_CHECKING: from ..._client import Finch, AsyncFinch diff --git a/src/finch/resources/providers.py b/src/finch/resources/providers.py index aa6eedc5..5f8b17c7 100644 --- a/src/finch/resources/providers.py +++ b/src/finch/resources/providers.py @@ -7,11 +7,20 @@ import httpx from ..types import Provider -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper from ..pagination import SyncSinglePage, AsyncSinglePage -from .._base_client import AsyncPaginator, make_request_options +from .._base_client import ( + AsyncPaginator, + make_request_options, +) if TYPE_CHECKING: from .._client import Finch, AsyncFinch diff --git a/src/finch/resources/request_forwarding.py b/src/finch/resources/request_forwarding.py index 2464bb35..4c571b39 100644 --- a/src/finch/resources/request_forwarding.py +++ b/src/finch/resources/request_forwarding.py @@ -6,12 +6,23 @@ import httpx -from ..types import RequestForwardingForwardResponse, request_forwarding_forward_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..types import ( + RequestForwardingForwardResponse, + request_forwarding_forward_params, +) +from .._types import ( + NOT_GIVEN, + Body, + Query, + Headers, + NotGiven, +) from .._utils import maybe_transform from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper -from .._base_client import make_request_options +from .._base_client import ( + make_request_options, +) if TYPE_CHECKING: from .._client import Finch, AsyncFinch diff --git a/src/finch/resources/webhooks.py b/src/finch/resources/webhooks.py index 13b88d61..2ef89a80 100644 --- a/src/finch/resources/webhooks.py +++ b/src/finch/resources/webhooks.py @@ -10,8 +10,12 @@ from typing import TYPE_CHECKING from datetime import datetime, timezone, timedelta -from .._types import HeadersLike -from .._utils import get_required_header +from .._types import ( + HeadersLike, +) +from .._utils import ( + get_required_header, +) from .._resource import SyncAPIResource, AsyncAPIResource if TYPE_CHECKING: diff --git a/src/finch/types/__init__.py b/src/finch/types/__init__.py index f6a15f80..cbf77492 100644 --- a/src/finch/types/__init__.py +++ b/src/finch/types/__init__.py @@ -4,9 +4,11 @@ from .money import Money as Money from .income import Income as Income -from .shared import Paging as Paging -from .shared import OperationSupport as OperationSupport -from .shared import OperationSupportMatrix as OperationSupportMatrix +from .shared import ( + Paging as Paging, + OperationSupport as OperationSupport, + OperationSupportMatrix as OperationSupportMatrix, +) from .location import Location as Location from .provider import Provider as Provider from .introspection import Introspection as Introspection diff --git a/src/finch/types/hris/__init__.py b/src/finch/types/hris/__init__.py index da28d4a5..0234b44b 100644 --- a/src/finch/types/hris/__init__.py +++ b/src/finch/types/hris/__init__.py @@ -23,27 +23,11 @@ from .individual_in_directory import IndividualInDirectory as IndividualInDirectory from .employment_data_response import EmploymentDataResponse as EmploymentDataResponse from .support_per_benefit_type import SupportPerBenefitType as SupportPerBenefitType -from .pay_statement_response_body import ( - PayStatementResponseBody as PayStatementResponseBody, -) -from .benefit_features_and_operations import ( - BenefitFeaturesAndOperations as BenefitFeaturesAndOperations, -) -from .employment_retrieve_many_params import ( - EmploymentRetrieveManyParams as EmploymentRetrieveManyParams, -) -from .individual_retrieve_many_params import ( - IndividualRetrieveManyParams as IndividualRetrieveManyParams, -) -from .update_company_benefit_response import ( - UpdateCompanyBenefitResponse as UpdateCompanyBenefitResponse, -) -from .create_company_benefits_response import ( - CreateCompanyBenefitsResponse as CreateCompanyBenefitsResponse, -) -from .directory_list_individuals_params import ( - DirectoryListIndividualsParams as DirectoryListIndividualsParams, -) -from .pay_statement_retrieve_many_params import ( - PayStatementRetrieveManyParams as PayStatementRetrieveManyParams, -) +from .pay_statement_response_body import PayStatementResponseBody as PayStatementResponseBody +from .benefit_features_and_operations import BenefitFeaturesAndOperations as BenefitFeaturesAndOperations +from .employment_retrieve_many_params import EmploymentRetrieveManyParams as EmploymentRetrieveManyParams +from .individual_retrieve_many_params import IndividualRetrieveManyParams as IndividualRetrieveManyParams +from .update_company_benefit_response import UpdateCompanyBenefitResponse as UpdateCompanyBenefitResponse +from .create_company_benefits_response import CreateCompanyBenefitsResponse as CreateCompanyBenefitsResponse +from .directory_list_individuals_params import DirectoryListIndividualsParams as DirectoryListIndividualsParams +from .pay_statement_retrieve_many_params import PayStatementRetrieveManyParams as PayStatementRetrieveManyParams diff --git a/src/finch/types/hris/benefits/__init__.py b/src/finch/types/hris/benefits/__init__.py index dc686ea2..0d548269 100644 --- a/src/finch/types/hris/benefits/__init__.py +++ b/src/finch/types/hris/benefits/__init__.py @@ -5,15 +5,9 @@ from .individual_benefit import IndividualBenefit as IndividualBenefit from .enrolled_individual import EnrolledIndividual as EnrolledIndividual from .unenrolled_individual import UnenrolledIndividual as UnenrolledIndividual -from .individual_enroll_many_params import ( - IndividualEnrollManyParams as IndividualEnrollManyParams, -) -from .individual_unenroll_many_params import ( - IndividualUnenrollManyParams as IndividualUnenrollManyParams, -) -from .individual_enrolled_ids_response import ( - IndividualEnrolledIDsResponse as IndividualEnrolledIDsResponse, -) +from .individual_enroll_many_params import IndividualEnrollManyParams as IndividualEnrollManyParams +from .individual_unenroll_many_params import IndividualUnenrollManyParams as IndividualUnenrollManyParams +from .individual_enrolled_ids_response import IndividualEnrolledIDsResponse as IndividualEnrolledIDsResponse from .individual_retrieve_many_benefits_params import ( IndividualRetrieveManyBenefitsParams as IndividualRetrieveManyBenefitsParams, ) diff --git a/src/finch/types/hris/benfit_contribution.py b/src/finch/types/hris/benfit_contribution.py index 676c3b8e..b3bee5cb 100644 --- a/src/finch/types/hris/benfit_contribution.py +++ b/src/finch/types/hris/benfit_contribution.py @@ -1,5 +1,7 @@ # File generated from our OpenAPI spec by Stainless. + + from .benefit_contribution import BenefitContribution BenfitContribution = BenefitContribution diff --git a/src/finch/types/jobs/__init__.py b/src/finch/types/jobs/__init__.py index 25ad24cf..b0470846 100644 --- a/src/finch/types/jobs/__init__.py +++ b/src/finch/types/jobs/__init__.py @@ -6,6 +6,4 @@ from .automated_async_job import AutomatedAsyncJob as AutomatedAsyncJob from .automated_list_params import AutomatedListParams as AutomatedListParams from .automated_create_params import AutomatedCreateParams as AutomatedCreateParams -from .automated_create_response import ( - AutomatedCreateResponse as AutomatedCreateResponse, -) +from .automated_create_response import AutomatedCreateResponse as AutomatedCreateResponse diff --git a/tests/utils.py b/tests/utils.py index bc62203d..2dc9c0da 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,7 +8,12 @@ from typing_extensions import Literal, get_args, get_origin, assert_type from finch._types import NoneType -from finch._utils import is_dict, is_list, is_list_type, is_union_type +from finch._utils import ( + is_dict, + is_list, + is_list_type, + is_union_type, +) from finch._compat import PYDANTIC_V2, field_outer_type, get_model_fields from finch._models import BaseModel