From 6d3f743ca50d59116603982ff592ae54ac9d63c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 07:36:17 +0000 Subject: [PATCH 1/2] Bump pyright from 1.1.373 to 1.1.374 in /deps Bumps [pyright](https://github.com/RobertCraigie/pyright-python) from 1.1.373 to 1.1.374. - [Release notes](https://github.com/RobertCraigie/pyright-python/releases) - [Commits](https://github.com/RobertCraigie/pyright-python/compare/v1.1.373...v1.1.374) --- updated-dependencies: - dependency-name: pyright dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- deps/requirements-pyright.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/requirements-pyright.txt b/deps/requirements-pyright.txt index c4aad36..f5a12d2 100644 --- a/deps/requirements-pyright.txt +++ b/deps/requirements-pyright.txt @@ -1 +1 @@ -pyright==1.1.373 +pyright==1.1.374 From f59cd600afbb23032beaedfdf505ca549772c14a Mon Sep 17 00:00:00 2001 From: Ryan Soklaski Date: Thu, 1 Aug 2024 13:46:22 -0400 Subject: [PATCH 2/2] pyright --- src/phantom_tensors/_internals/dim_binding.py | 4 ++-- tests/annotations.py | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/phantom_tensors/_internals/dim_binding.py b/src/phantom_tensors/_internals/dim_binding.py index 269e384..a90f9c1 100644 --- a/src/phantom_tensors/_internals/dim_binding.py +++ b/src/phantom_tensors/_internals/dim_binding.py @@ -6,7 +6,7 @@ from functools import wraps from typing import Any, Callable, Iterable, Optional, Tuple, Type, TypeVar, Union, cast -from typing_extensions import Final, TypeAlias +from typing_extensions import TypeAlias import phantom_tensors._internals.utils as _utils from phantom_tensors._internals.utils import LiteralLike, NewTypeLike, UnpackLike @@ -92,7 +92,7 @@ def check(shape_type: Tuple[ShapeDimType, ...], shape: Tuple[int, ...]) -> bool: # if variadic tuple is present, need to use negative indexing to reference # location from the end of the tuple - CURRENT_INDEX: Final = n if var_field_ind is None else n - len(shape_type) + CURRENT_INDEX = n if var_field_ind is None else n - len(shape_type) # The following symbols bind to dimensions (by symbol-reference) # Some of them may also carry with them additional validation checks, diff --git a/tests/annotations.py b/tests/annotations.py index 46e9f97..7b3c2ce 100644 --- a/tests/annotations.py +++ b/tests/annotations.py @@ -77,16 +77,11 @@ def check_bad_tensor_parse(x: tr.Tensor): def check_readme_blurb_one(): - from typing import NewType - import numpy as np from phantom_tensors import parse from phantom_tensors.numpy import NDArray - A = NewType("A", int) - B = NewType("B", int) - # runtime: checks that shapes (2, 3) and (3, 2) # match (A, B) and (B, A) pattern if sys.version_info < (3, 8):