try updating mypy
MODIFY
.pre-commit-config.yaml
.pre-commit-config.yaml
@@ -28,7 +28,7 @@ repos:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: 'v0.812'
+ rev: 'v0.910'
hooks:
- id: mypy
exclude: tests

MODIFY
pangeo_forge_recipes/executors/base.py
pangeo_forge_recipes/executors/base.py
import enum
from dataclasses import dataclass
-from typing import Any, Callable, Dict, Generic, Hashable, Iterable, Optional, Protocol, TypeVar
+from typing import Any, Dict, Generic, Hashable, Iterable, Optional, Protocol, TypeVar, Union
+# there is no good way to type hint a dataclass
+# https://stackoverflow.com/questions/54668000/type-hint-for-an-instance-of-a-non-specific-dataclass
Config = Any
@@ -17,14 +19,14 @@ class SingleArgumentStageFunction(Protocol):
# For some reason, mypy does not like this
-# StageFunction = Union[NoArgumentStageFunction, SingleArgumentStageFunction]
+StageFunction = Union[NoArgumentStageFunction, SingleArgumentStageFunction]
# pangeo_forge_recipes/recipes/xarray_zarr.py:525: error:
# Argument "function" to "Stage" has incompatible type
# "Callable[[Index, NamedArg(XarrayZarrRecipe, 'config')], None]";
# expected "NoArgumentStageFunction" [arg-type]
# TODO: fix this to be a stricter type as above
-StageFunction = Callable
+# StageFunction = Callable
class StageAnnotationType(enum.Enum):

MODIFY
setup.cfg
setup.cfg
@@ -86,3 +86,5 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-zarr.*]
ignore_missing_imports = True
+[mypy-yaml.*]
+ignore_missing_imports = True

try updating mypy