diff --git a/esmvalcore/_task.py b/esmvalcore/_task.py index cf2ddda20b..94b6b2f824 100644 --- a/esmvalcore/_task.py +++ b/esmvalcore/_task.py @@ -13,10 +13,8 @@ import time from copy import deepcopy from multiprocessing import Pool -from multiprocessing.pool import ApplyResult from pathlib import Path, PosixPath from shutil import which -from typing import Dict, Type import psutil import yaml @@ -736,7 +734,7 @@ def _run_sequential(self) -> None: def _run_parallel(self, max_parallel_tasks=None): """Run tasks in parallel.""" scheduled = self.flatten() - running: Dict[Type[BaseTask], Type[ApplyResult]] = {} + running = {} n_tasks = n_scheduled = len(scheduled) n_running = 0 diff --git a/setup.cfg b/setup.cfg index 5550bd7fbc..88fee9d4fc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,6 +33,8 @@ multi_line_output = 3 include_trailing_comma = true [mypy] +# see mypy.readthedocs.io/en/stable/command_line.html +implicit_optional = True ignore_missing_imports = True files = esmvalcore, tests