From 695c174b59b88bfd6d2b4d82b9e927f01391ba6f Mon Sep 17 00:00:00 2001 From: Florian Deconinck Date: Wed, 24 Apr 2024 11:33:53 -0400 Subject: [PATCH] Update to `mypy` 1.4.1 Fix TypeVar returning without concrete allocation --- .pre-commit-config.yaml | 3 ++- ndsl/types.py | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8e20734..8df5e5a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,11 +15,12 @@ repos: args: ["--profile", "black"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.812 + rev: v1.4.1 hooks: - id: mypy name: mypy-ndsl args: [--config-file, setup.cfg] + additional_dependencies: [types-PyYAML] files: ndsl exclude: | (?x)^( diff --git a/ndsl/types.py b/ndsl/types.py index 6c4ce59..e3461c3 100644 --- a/ndsl/types.py +++ b/ndsl/types.py @@ -9,7 +9,7 @@ class Allocator(Protocol): - def __call__(self, shape: Iterable[int], dtype: type) -> Array: + def __call__(self, shape: Iterable[int], dtype: type): pass @@ -21,23 +21,23 @@ class NumpyModule(Protocol): @functools.wraps(np.rot90) def rot90(self, *args, **kwargs): - ... + pass @functools.wraps(np.sum) def sum(self, *args, **kwargs): - ... + pass @functools.wraps(np.log) def log(self, *args, **kwargs): - ... + pass @functools.wraps(np.sin) def sin(self, *args, **kwargs): - ... + pass @functools.wraps(np.asarray) def asarray(self, *args, **kwargs): - ... + pass class AsyncRequest(Protocol):