Upgrade mypy to 0.910.
MODIFY
requirements.txt
requirements.txt
@@ -10,5 +10,8 @@ pytest-cov
-e ./zulip_bots
-e ./zulip_botserver
-e git+https://github.com/zulip/zulint@14e3974001bf8442a6a3486125865660f1f2eb68#egg=zulint==1.0.0
-mypy==0.812
+mypy==0.910
+types-python-dateutil
+types-pytz
+types-requests
gitlint>=0.13.0

MODIFY
zulip/tests/__init__.py
zulip/tests/__init__.py
import pkgutil
-from typing import Iterable
+from typing import List
-__path__ = pkgutil.extend_path(__path__, __name__) # type: Iterable[str]
+__path__ = pkgutil.extend_path(__path__, __name__) # type: List[str]

MODIFY
zulip_bots/zulip_bots/bots/witai/witai.py
zulip_bots/zulip_bots/bots/witai/witai.py
@@ -80,6 +80,8 @@ def get_handle(location: str) -> Optional[Callable[[Dict[str, Any]], Optional[st
"""
try:
spec = importlib.util.spec_from_file_location("module.name", location)
+ if spec is None:
+ return None
handler = importlib.util.module_from_spec(spec)
loader = spec.loader
if not isinstance(loader, importlib.abc.Loader):

MODIFY
zulip_bots/zulip_bots/finder.py
zulip_bots/zulip_bots/finder.py
@@ -13,6 +13,8 @@ import importlib_metadata as metadata
def import_module_from_source(path: str, name: str) -> Any:
spec = importlib.util.spec_from_file_location(name, path)
+ if spec is None:
+ return None
module = importlib.util.module_from_spec(spec)
loader = spec.loader
if not isinstance(loader, importlib.abc.Loader):

MODIFY
zulip_botserver/tests/__init__.py
zulip_botserver/tests/__init__.py
import pkgutil
-from typing import Iterable
+from typing import List
-__path__ = pkgutil.extend_path(__path__, __name__) # type: Iterable[str]
+__path__ = pkgutil.extend_path(__path__, __name__) # type: List[str]

Upgrade mypy to 0.910.

Signed-off-by: Anders Kaseorg <anders@zulip.com>