diff --git a/pyproject.toml b/pyproject.toml index 59fcb8e2..b831f420 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 = [ - # version pins are in requirements-dev.lock - "pyright", - "mypy", - "black", - "respx", - "pytest", - "pytest-asyncio", - "ruff", - "time-machine", - "nox", + "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", "dirty-equals>=0.6.0", ] @@ -65,10 +65,12 @@ 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 ." @@ -123,13 +125,16 @@ reportImplicitOverride = true reportImportCycles = false reportPrivateUsage = false +[tool.isort] +profile = "black" +length_sort = true +extra_standard_library = ["typing_extensions"] + [tool.ruff] line-length = 120 -output-format = "grouped" +format = "grouped" target-version = "py37" select = [ - # isort - "I", # remove unused imports "F401", # bare except statements @@ -147,12 +152,6 @@ 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 36843262..ce154682 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -25,6 +25,7 @@ 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 @@ -42,7 +43,7 @@ pytest-asyncio==0.21.1 python-dateutil==2.8.2 pytz==2023.3.post1 respx==0.20.2 -ruff==0.1.7 +ruff==0.0.282 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 3c3b9636..149406a0 100644 --- a/src/finch/_client.py +++ b/src/finch/_client.py @@ -22,12 +22,10 @@ AsyncTransport, RequestOptions, ) -from ._utils import ( - is_given, - get_async_library, -) +from ._utils import is_given, get_async_library from ._version import __version__ -from ._streaming import Stream as Stream, AsyncStream as AsyncStream +from ._streaming import Stream as Stream +from ._streaming import 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 d95db8ed..34323c9b 100644 --- a/src/finch/_compat.py +++ b/src/finch/_compat.py @@ -43,23 +43,21 @@ def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001 else: if PYDANTIC_V2: - 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 + 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 else: - 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 + 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 # refactored config diff --git a/src/finch/_models.py b/src/finch/_models.py index cdd44ccb..5b8c9601 100644 --- a/src/finch/_models.py +++ b/src/finch/_models.py @@ -30,11 +30,17 @@ AnyMapping, HttpxRequestFiles, ) -from ._utils import is_list, is_given, is_mapping, parse_date, parse_datetime, strip_not_given +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 ._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 7f82cf4a..e12f064d 100644 --- a/src/finch/_types.py +++ b/src/finch/_types.py @@ -19,7 +19,14 @@ 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 e98636c9..400ca9b8 100644 --- a/src/finch/_utils/__init__.py +++ b/src/finch/_utils/__init__.py @@ -1,41 +1,37 @@ from ._proxy import LazyProxy as LazyProxy -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, -) +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 diff --git a/src/finch/_utils/_utils.py b/src/finch/_utils/_utils.py index cce69238..83f88cc3 100644 --- a/src/finch/_utils/_utils.py +++ b/src/finch/_utils/_utils.py @@ -21,7 +21,9 @@ import sniffio from .._types import Headers, NotGiven, FileTypes, NotGivenOr, HeadersLike -from .._compat import is_union as _is_union, parse_date as parse_date, parse_datetime as parse_datetime +from .._compat import is_union as _is_union +from .._compat import parse_date as parse_date +from .._compat import 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 32d0cf28..dcab5333 100644 --- a/src/finch/resources/__init__.py +++ b/src/finch/resources/__init__.py @@ -2,9 +2,19 @@ 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 0cb7b3aa..5d90dfdc 100644 --- a/src/finch/resources/account.py +++ b/src/finch/resources/account.py @@ -7,18 +7,10 @@ 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 8f292e8f..4659abb9 100644 --- a/src/finch/resources/hris/__init__.py +++ b/src/finch/resources/hris/__init__.py @@ -7,11 +7,36 @@ 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 9a5b9063..fbbe99ea 100644 --- a/src/finch/resources/hris/benefits/__init__.py +++ b/src/finch/resources/hris/benefits/__init__.py @@ -1,7 +1,17 @@ # 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 4752a838..f90a5100 100644 --- a/src/finch/resources/hris/benefits/benefits.py +++ b/src/finch/resources/hris/benefits/benefits.py @@ -6,15 +6,14 @@ 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 .individuals import Individuals, AsyncIndividuals, IndividualsWithRawResponse, AsyncIndividualsWithRawResponse +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 @@ -28,10 +27,7 @@ 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 cb09ddf4..fb4b3450 100644 --- a/src/finch/resources/hris/benefits/individuals.py +++ b/src/finch/resources/hris/benefits/individuals.py @@ -6,21 +6,12 @@ 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 3ee67da7..af6d6441 100644 --- a/src/finch/resources/hris/company.py +++ b/src/finch/resources/hris/company.py @@ -6,19 +6,11 @@ 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 221586f6..ff3950aa 100644 --- a/src/finch/resources/hris/directory.py +++ b/src/finch/resources/hris/directory.py @@ -7,25 +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 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 c0bd79ba..0b16202e 100644 --- a/src/finch/resources/hris/employments.py +++ b/src/finch/resources/hris/employments.py @@ -6,22 +6,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 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 0ba66160..8cd4f554 100644 --- a/src/finch/resources/hris/hris.py +++ b/src/finch/resources/hris/hris.py @@ -10,12 +10,37 @@ 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 8ca24125..892eb820 100644 --- a/src/finch/resources/hris/individuals.py +++ b/src/finch/resources/hris/individuals.py @@ -6,22 +6,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 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 6ad4be76..4c444e9b 100644 --- a/src/finch/resources/hris/pay_statements.py +++ b/src/finch/resources/hris/pay_statements.py @@ -6,22 +6,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 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 d5d0b28d..17364d80 100644 --- a/src/finch/resources/hris/payments.py +++ b/src/finch/resources/hris/payments.py @@ -7,22 +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 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 112d3130..f1f7692d 100644 --- a/src/finch/resources/jobs/__init__.py +++ b/src/finch/resources/jobs/__init__.py @@ -1,8 +1,18 @@ # 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 48f2199b..9f43c60a 100644 --- a/src/finch/resources/jobs/automated.py +++ b/src/finch/resources/jobs/automated.py @@ -7,13 +7,7 @@ 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 @@ -24,10 +18,7 @@ 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 a47c4ddd..f522c9c5 100644 --- a/src/finch/resources/jobs/jobs.py +++ b/src/finch/resources/jobs/jobs.py @@ -4,8 +4,18 @@ 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 61f16619..9334f2da 100644 --- a/src/finch/resources/jobs/manual.py +++ b/src/finch/resources/jobs/manual.py @@ -6,19 +6,11 @@ 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 5f8b17c7..aa6eedc5 100644 --- a/src/finch/resources/providers.py +++ b/src/finch/resources/providers.py @@ -7,20 +7,11 @@ 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 4c571b39..2464bb35 100644 --- a/src/finch/resources/request_forwarding.py +++ b/src/finch/resources/request_forwarding.py @@ -6,23 +6,12 @@ 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 2ef89a80..13b88d61 100644 --- a/src/finch/resources/webhooks.py +++ b/src/finch/resources/webhooks.py @@ -10,12 +10,8 @@ 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 ece2573d..f6a15f80 100644 --- a/src/finch/types/__init__.py +++ b/src/finch/types/__init__.py @@ -4,14 +4,16 @@ from .money import Money as Money from .income import Income as Income -from .shared import ( - Paging as Paging, - OperationSupport as OperationSupport, - OperationSupportMatrix as OperationSupportMatrix, -) +from .shared import Paging as Paging +from .shared import OperationSupport as OperationSupport +from .shared import OperationSupportMatrix as OperationSupportMatrix from .location import Location as Location from .provider import Provider as Provider from .introspection import Introspection as Introspection from .disconnect_response import DisconnectResponse as DisconnectResponse -from .request_forwarding_forward_params import RequestForwardingForwardParams as RequestForwardingForwardParams -from .request_forwarding_forward_response import RequestForwardingForwardResponse as RequestForwardingForwardResponse +from .request_forwarding_forward_params import ( + RequestForwardingForwardParams as RequestForwardingForwardParams, +) +from .request_forwarding_forward_response import ( + RequestForwardingForwardResponse as RequestForwardingForwardResponse, +) diff --git a/src/finch/types/hris/__init__.py b/src/finch/types/hris/__init__.py index 0234b44b..da28d4a5 100644 --- a/src/finch/types/hris/__init__.py +++ b/src/finch/types/hris/__init__.py @@ -23,11 +23,27 @@ 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 0d548269..dc686ea2 100644 --- a/src/finch/types/hris/benefits/__init__.py +++ b/src/finch/types/hris/benefits/__init__.py @@ -5,9 +5,15 @@ 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 b3bee5cb..676c3b8e 100644 --- a/src/finch/types/hris/benfit_contribution.py +++ b/src/finch/types/hris/benfit_contribution.py @@ -1,7 +1,5 @@ # 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 b0470846..25ad24cf 100644 --- a/src/finch/types/jobs/__init__.py +++ b/src/finch/types/jobs/__init__.py @@ -6,4 +6,6 @@ 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 2dc9c0da..bc62203d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,12 +8,7 @@ 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