File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
from collections .abc import Sequence
2
2
from enum import Enum , unique
3
+ from importlib .metadata import version
3
4
from typing import Any
4
5
5
6
from mypy .checkmember import analyze_member_access
22
23
get_proper_type ,
23
24
)
24
25
from mypy .types import Type as MypyType
25
- from mypy .version import __version__ as mypy_version
26
26
27
27
from returns .contrib .mypy ._typeops .fallback import asserts_fallback_to_any
28
28
from returns .contrib .mypy ._typeops .visitor import translate_kind_instance
@@ -64,6 +64,7 @@ def attribute_access(ctx: AttributeContext) -> MypyType:
64
64
return ctx .default_attr_type
65
65
66
66
exprchecker = ctx .api .expr_checker # type: ignore
67
+ mypy_version = version ('mypy' )
67
68
mypy_version_tuple = tuple (
68
69
map (int , mypy_version .partition ('+' )[0 ].split ('.' ))
69
70
)
Original file line number Diff line number Diff line change 1
1
from collections .abc import Sequence
2
+ from importlib .metadata import version
2
3
from types import MappingProxyType
3
4
from typing import Any , Final , Literal , overload
4
5
5
6
from mypy .checkmember import analyze_member_access
6
7
from mypy .nodes import ARG_NAMED , ARG_OPT
7
8
from mypy .types import CallableType , FunctionLike , ProperType , get_proper_type
8
9
from mypy .types import Type as MypyType
9
- from mypy .version import __version__ as mypy_version
10
10
11
11
from returns .contrib .mypy ._structures .args import FuncArg
12
12
from returns .contrib .mypy ._structures .types import CallableContext
@@ -119,6 +119,7 @@ def translate_to_function(
119
119
"""
120
120
checker = ctx .api .expr_checker # type: ignore
121
121
122
+ mypy_version = version ('mypy' )
122
123
mypy_version_tuple = tuple (
123
124
map (int , mypy_version .partition ('+' )[0 ].split ('.' ))
124
125
)
You can’t perform that action at this time.
0 commit comments