提交 d88f3f9e authored 作者: Michael Osthege's avatar Michael Osthege

Upgrade to mypy v0.991 and fix mypy errors

上级 5aa17801
...@@ -47,7 +47,7 @@ repos: ...@@ -47,7 +47,7 @@ repos:
)$ )$
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982 rev: v0.991
hooks: hooks:
- id: mypy - id: mypy
additional_dependencies: additional_dependencies:
......
...@@ -2440,8 +2440,9 @@ class GCC_compiler(Compiler): ...@@ -2440,8 +2440,9 @@ class GCC_compiler(Compiler):
def linking_patch(lib_dirs: List[str], libs: List[str]) -> List[str]: def linking_patch(lib_dirs: List[str], libs: List[str]) -> List[str]:
if sys.platform != "win32": if sys.platform != "win32":
return [f"-l{l}" for l in libs] return [f"-l{l}" for l in libs]
else:
def sort_key(lib): # type: ignore # In explicit else because of https://github.com/python/mypy/issues/10773
def sort_key(lib):
name, *numbers, extension = lib.split(".") name, *numbers, extension = lib.split(".")
return (extension == "dll", tuple(map(int, numbers))) return (extension == "dll", tuple(map(int, numbers)))
......
...@@ -1056,7 +1056,7 @@ class VMLinker(LocalLinker): ...@@ -1056,7 +1056,7 @@ class VMLinker(LocalLinker):
callback=self.callback, callback=self.callback,
callback_input=self.callback_input, callback_input=self.callback_input,
) )
elif self.use_cloop and CVM: elif self.use_cloop and CVM is not None:
# create a map from nodes to ints and vars to ints # create a map from nodes to ints and vars to ints
nodes_idx = {} nodes_idx = {}
......
...@@ -3449,7 +3449,7 @@ def profile_printer( ...@@ -3449,7 +3449,7 @@ def profile_printer(
@op_debug_information.register(Scan) # type: ignore[has-type] @op_debug_information.register(Scan) # type: ignore[has-type]
def _op_debug_information_Scan(op, node): def _op_debug_information_Scan(op: Scan, node: Apply):
from typing import Sequence from typing import Sequence
from aesara.scan.utils import ScanArgs from aesara.scan.utils import ScanArgs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论