From f406472bff10415cab4bd61329525f4f005770ae Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Thu, 18 Apr 2024 14:39:08 +0000 Subject: [PATCH] chore(internal): bump pyright to 1.1.359 --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- src/finch/_models.py | 2 +- src/finch/_utils/_utils.py | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e33509c6..71c80b9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ Repository = "https://github.com/Finch-API/finch-api-python" managed = true # version pins are in requirements-dev.lock dev-dependencies = [ - "pyright", + "pyright>=1.1.359", "mypy", "respx", "pytest", diff --git a/requirements-dev.lock b/requirements-dev.lock index 672caedf..0407fa1e 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -63,7 +63,7 @@ pydantic==2.4.2 # via finch-api pydantic-core==2.10.1 # via pydantic -pyright==1.1.353 +pyright==1.1.359 pytest==7.1.1 # via pytest-asyncio pytest-asyncio==0.21.1 diff --git a/src/finch/_models.py b/src/finch/_models.py index ff93fbd8..ff3f54e2 100644 --- a/src/finch/_models.py +++ b/src/finch/_models.py @@ -378,7 +378,7 @@ def construct_type(*, value: object, type_: object) -> object: # unwrap `Annotated[T, ...]` -> `T` if is_annotated_type(type_): - meta = get_args(type_)[1:] + meta: tuple[Any, ...] = get_args(type_)[1:] type_ = extract_type_arg(type_, 0) else: meta = tuple() diff --git a/src/finch/_utils/_utils.py b/src/finch/_utils/_utils.py index fd3a8a4d..17904ce6 100644 --- a/src/finch/_utils/_utils.py +++ b/src/finch/_utils/_utils.py @@ -265,6 +265,8 @@ def wrapper(*args: object, **kwargs: object) -> object: ) msg = f"Missing required arguments; Expected either {variations} arguments to be given" else: + assert len(variants) > 0 + # TODO: this error message is not deterministic missing = list(set(variants[0]) - given_params) if len(missing) > 1: