Skip to content
Commit 93385f05 authored by Matthew Hughes's avatar Matthew Hughes
Browse files

Update `mypy` to `v1`+

This includes removing some now unused ignores, and fixing some new
errors:

    isort/sorting.py:120: error: Unused "type: ignore" comment  [unused-ignore]
    isort/settings.py:869: error: Unused "type: ignore" comment  [unused-ignore]
    isort/literal.py:89: error: Unused "type: ignore" comment  [unused-ignore]
    isort/deprecated/finders.py:32: error: Incompatible types in assignment (expression has type "None", variable has type "Callable[[PathLike[Any], Optional[Any], bool, bool], Dict[str, Union[Requirement, UnparsedRequirement]]]")  [assignment]
    isort/api.py:196: error: No overload variant of "compile" matches argument types "str", "str", "str", "int", "int"  [call-overload]
    isort/api.py:196: note: Possible overload variants:
    isort/api.py:196: note:     def compile(source: Union[str, Buffer, Module, Expression, Interactive], filename: Union[str, Buffer, _PathLike[Any]], mode: str, flags: Literal[0], dont_inherit: bool = ..., optimize: int = ..., *, _feature_version: int = ...) -> CodeType
    isort/api.py:196: note:     def compile(source: Union[str, Buffer, Module, Expression, Interactive], filename: Union[str, Buffer, _PathLike[Any]], mode: str, *, dont_inherit: bool = ..., optimize: int = ..., _feature_version: int = ...) -> CodeType
    isort/api.py:196: note:     def compile(source: Union[str, Buffer, Module, Expression, Interactive], filename: Union[str, Buffer, _PathLike[Any]], mode: str, flags: Literal[1024], dont_inherit: bool = ..., optimize: int = ..., *, _feature_version: int = ...) -> AST
    isort/api.py:196: note:     def compile(source: Union[str, Buffer, Module, Expression, Interactive], filename: Union[str, Buffer, _PathLike[Any]], mode: str, flags: int, dont_inherit: bool = ..., optimize: int = ..., *, _feature_version: int = ...) -> Any
    isort/api.py:223: error: No overload variant of "compile" matches argument types "str", "str", "str", "int", "int"  [call-overload]
    isort/api.py:223: note: Possible overload variants:
    isort/api.py:223: note:     def compile(source: Union[str, Buffer, Module, Expression, Interactive], filename: Union[str, Buffer, _PathLike[Any]], mode: str, flags: Literal[0], dont_inherit: bool = ..., optimize: int = ..., *, _feature_version: int = ...) -> CodeType
    isort/api.py:223: note:     def compile(source: Union[str, Buffer, Module, Expression, Interactive], filename: Union[str, Buffer, _PathLike[Any]], mode: str, *, dont_inherit: bool = ..., optimize: int = ..., _feature_version: int = ...) -> CodeType
    isort/api.py:223: note:     def compile(source: Union[str, Buffer, Module, Expression, Interactive], filename: Union[str, Buffer, _PathLike[Any]], mode: str, flags: Literal[1024], dont_inherit: bool = ..., optimize: int = ..., *, _feature_version: int = ...) -> AST
    isort/api.py:223: note:     def compile(source: Union[str, Buffer, Module, Expression, Interactive], filename: Union[str, Buffer, _PathLike[Any]], mode: str, flags: int, dont_inherit: bool = ..., optimize: int = ..., *, _feature_version: int = ...) -> Any
    tests/integration/test_setting_combinations.py:64: error: Unused "type: ignore" comment  [unused-ignore]
    tests/unit/test_isort.py:5550: error: Signature of "seek" incompatible with supertype "TextIOWrapper"  [override]
    tests/unit/test_isort.py:5550: note:      Superclass:
    tests/unit/test_isort.py:5550: note:          def seek(self, int, int = ..., /) -> int
    tests/unit/test_isort.py:5550: note:      Subclass:
    tests/unit/test_isort.py:5550: note:          def seek(self, position: Any) -> Any
    tests/unit/test_isort.py:5550: error: Signature of "seek" incompatible with supertype "IOBase"  [override]
    tests/unit/test_isort.py:5550: note:      Superclass:
    tests/unit/test_isort.py:5550: note:          def seek(self, int, int = ..., /) -> int
    tests/unit/test_isort.py:5550: note:      Subclass:
    tests/unit/test_isort.py:5550: note:          def seek(self, position: Any) -> Any
    tests/unit/test_isort.py:5550: error: Signature of "seek" incompatible with supertype "IO"  [override]
    tests/unit/test_isort.py:5550: note:      Superclass:
    tests/unit/test_isort.py:5550: note:          def seek(self, int, int = ..., /) -> int
    tests/unit/test_isort.py:5550: note:      Subclass:
    tests/unit/test_isort.py:5550: note:          def seek(self, position: Any) -> Any
    tests/integration/test_hypothesmith.py:69: error: Unused "type: ignore" comment  [unused-ignore]
    Found 11 errors in 8 files (checked 88 source files)
parent c85b575d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment