From 760cb764583f2580c4109100fe1d4bf0b3443022 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Thu, 18 Apr 2024 10:39:03 -0400 Subject: [PATCH] chore(internal): bump pyright to 1.1.359 (#466) --- pyproject.toml | 2 +- requirements-dev.lock | 8 ++++---- src/anthropic/_models.py | 2 +- src/anthropic/_utils/_utils.py | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0d39e2bf..d905a605 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ Repository = "https://github.com/anthropics/anthropic-sdk-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 1b42bb70..de7b55f9 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -24,7 +24,7 @@ botocore==1.31.58 # via anthropic # via boto3 # via s3transfer -botocore-stubs==1.34.69 +botocore-stubs==1.34.86 # via boto3-stubs cachetools==5.3.3 # via google-auth @@ -94,7 +94,7 @@ pydantic==2.4.2 # via anthropic 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 @@ -129,9 +129,9 @@ tomli==2.0.1 # via pytest tqdm==4.66.2 # via huggingface-hub -types-awscrt==0.20.5 +types-awscrt==0.20.9 # via botocore-stubs -types-s3transfer==0.10.0 +types-s3transfer==0.10.1 # via boto3-stubs typing-extensions==4.8.0 # via anthropic diff --git a/src/anthropic/_models.py b/src/anthropic/_models.py index ff93fbd8..ff3f54e2 100644 --- a/src/anthropic/_models.py +++ b/src/anthropic/_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/anthropic/_utils/_utils.py b/src/anthropic/_utils/_utils.py index fd3a8a4d..17904ce6 100644 --- a/src/anthropic/_utils/_utils.py +++ b/src/anthropic/_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: