Revert "[BE]: Update mypy to 1.10.0 (#127717)"

This reverts commit 30213ab0a7.

Reverted https://github.com/pytorch/pytorch/pull/127717 on behalf of https://github.com/huydhn due to I am not sure why but the failures look legit and they are showing up in trunk 30213ab0a7 ([comment](https://github.com/pytorch/pytorch/pull/127717#issuecomment-2144183347))
This commit is contained in:
PyTorch MergeBot 2024-06-03 02:52:47 +00:00
parent e57f51b80f
commit 84776d7597
6 changed files with 7 additions and 11 deletions

View File

@ -85,10 +85,10 @@ librosa>=0.6.2 ; python_version < "3.11"
#Pinned versions:
#test that import:
mypy==1.10.0
mypy==1.9.0
# Pin MyPy version because new errors are likely to appear with each release
#Description: linter
#Pinned versions: 1.10.0
#Pinned versions: 1.9.0
#test that import: test_typing.py, test_type_hints.py
networkx==2.8.8

View File

@ -136,7 +136,7 @@ init_command = [
'numpy==1.24.3 ; python_version == "3.8"',
'numpy==1.26.0 ; python_version >= "3.9"',
'expecttest==0.1.6',
'mypy==1.10.0',
'mypy==1.9.0',
'sympy==1.11.1',
'types-requests==2.27.25',
'types-PyYAML==6.0.7',

View File

@ -44,7 +44,7 @@ class DefaultFuseHandler(FuseHandler):
def __init__(
self,
node: Node):
super().__init__(node) # type:ignore[safe-super]
super().__init__(node)
def fuse(self,
load_arg: Callable,

View File

@ -342,8 +342,4 @@ def register_fsdp_forward_method(module: nn.Module, method_name: str) -> None:
return fsdp_state._post_forward(self, args, out)
# Use `__get__` to make `wrapped_method` an instance method
setattr(
module,
method_name,
wrapped_method.__get__(module, type(module)), # type:ignore[attr-defined]
)
setattr(module, method_name, wrapped_method.__get__(module, type(module)))

View File

@ -117,7 +117,7 @@ class lazy_property:
def __init__(self, wrapped):
self.wrapped = wrapped
update_wrapper(self, wrapped) # type:ignore[arg-type]
update_wrapper(self, wrapped)
def __get__(self, instance, obj_type=None):
if instance is None:

View File

@ -60,7 +60,7 @@ class AST_Rewriter(ast.NodeTransformer):
closure=f.__closure__,
)
g = functools.update_wrapper(g, f)
g.__kwdefaults__ = copy.copy(f.__kwdefaults__) # type:ignore[attr-defined]
g.__kwdefaults__ = copy.copy(f.__kwdefaults__)
return g
# Return the correct FunctionType object
return change_func_globals(fn_compiled, globals=fn.__globals__)