Coverage for pydantic/mypy.py: 100.00%

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

381 statements  

1from configparser import ConfigParser linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

2from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type as TypingType, Union linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

3 

4from mypy.errorcodes import ErrorCode linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

5from mypy.nodes import ( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

6 ARG_NAMED, 

7 ARG_NAMED_OPT, 

8 ARG_OPT, 

9 ARG_POS, 

10 ARG_STAR2, 

11 MDEF, 

12 Argument, 

13 AssignmentStmt, 

14 Block, 

15 CallExpr, 

16 ClassDef, 

17 Context, 

18 Decorator, 

19 EllipsisExpr, 

20 FuncBase, 

21 FuncDef, 

22 JsonDict, 

23 MemberExpr, 

24 NameExpr, 

25 PassStmt, 

26 PlaceholderNode, 

27 RefExpr, 

28 StrExpr, 

29 SymbolNode, 

30 SymbolTableNode, 

31 TempNode, 

32 TypeInfo, 

33 TypeVarExpr, 

34 Var, 

35) 

36from mypy.options import Options linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

37from mypy.plugin import CheckerPluginInterface, ClassDefContext, MethodContext, Plugin, SemanticAnalyzerPluginInterface linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

38from mypy.plugins import dataclasses linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

39from mypy.semanal import set_callable_name # type: ignore linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

40from mypy.server.trigger import make_wildcard_trigger linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

41from mypy.types import ( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

42 AnyType, 

43 CallableType, 

44 Instance, 

45 NoneType, 

46 Type, 

47 TypeOfAny, 

48 TypeType, 

49 TypeVarType, 

50 UnionType, 

51 get_proper_type, 

52) 

53from mypy.typevars import fill_typevars linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

54from mypy.util import get_unique_redefinition_name linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

55from mypy.version import __version__ as mypy_version linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

56 

57from pydantic.utils import is_valid_field linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

58 

59try: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

60 from mypy.types import TypeVarDef # type: ignore[attr-defined] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

61except ImportError: # pragma: no cover linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

62 # Backward-compatible with TypeVarDef from Mypy 0.910. 

63 from mypy.types import TypeVarType as TypeVarDef linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

64 

65CONFIGFILE_KEY = 'pydantic-mypy' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

66METADATA_KEY = 'pydantic-mypy-metadata' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

67BASEMODEL_FULLNAME = 'pydantic.main.BaseModel' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

68BASESETTINGS_FULLNAME = 'pydantic.env_settings.BaseSettings' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

69FIELD_FULLNAME = 'pydantic.fields.Field' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

70DATACLASS_FULLNAME = 'pydantic.dataclasses.dataclass' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

71BUILTINS_NAME = 'builtins' if float(mypy_version) >= 0.930 else '__builtins__' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

72 

73 

74def plugin(version: str) -> 'TypingType[Plugin]': linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

75 """ 

76 `version` is the mypy version string 

77 

78 We might want to use this to print a warning if the mypy version being used is 

79 newer, or especially older, than we expect (or need). 

80 """ 

81 return PydanticPlugin linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

82 

83 

84class PydanticPlugin(Plugin): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

85 def __init__(self, options: Options) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

86 self.plugin_config = PydanticPluginConfig(options) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

87 super().__init__(options) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

88 

89 def get_base_class_hook(self, fullname: str) -> 'Optional[Callable[[ClassDefContext], None]]': linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

90 sym = self.lookup_fully_qualified(fullname) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

91 if sym and isinstance(sym.node, TypeInfo): # pragma: no branch linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

92 # No branching may occur if the mypy cache has not been cleared 

93 if any(get_fullname(base) == BASEMODEL_FULLNAME for base in sym.node.mro): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

94 return self._pydantic_model_class_maker_callback linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

95 return None linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

96 

97 def get_method_hook(self, fullname: str) -> Optional[Callable[[MethodContext], Type]]: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

98 if fullname.endswith('.from_orm'): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

99 return from_orm_callback linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

100 return None linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

101 

102 def get_class_decorator_hook(self, fullname: str) -> Optional[Callable[[ClassDefContext], None]]: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

103 if fullname == DATACLASS_FULLNAME: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

104 return dataclasses.dataclass_class_maker_callback linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

105 return None linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

106 

107 def _pydantic_model_class_maker_callback(self, ctx: ClassDefContext) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

108 transformer = PydanticModelTransformer(ctx, self.plugin_config) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

109 transformer.transform() linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

110 

111 

112class PydanticPluginConfig: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

113 __slots__ = ('init_forbid_extra', 'init_typed', 'warn_required_dynamic_aliases', 'warn_untyped_fields') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

114 init_forbid_extra: bool linux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

115 init_typed: bool linux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

116 warn_required_dynamic_aliases: bool linux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

117 warn_untyped_fields: bool linux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

118 

119 def __init__(self, options: Options) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

120 if options.config_file is None: # pragma: no cover linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

121 return 

122 

123 toml_config = parse_toml(options.config_file) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

124 if toml_config is not None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

125 config = toml_config.get('tool', {}).get('pydantic-mypy', {}) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

126 for key in self.__slots__: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

127 setting = config.get(key, False) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

128 if not isinstance(setting, bool): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

129 raise ValueError(f'Configuration value must be a boolean for key: {key}') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

130 setattr(self, key, setting) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

131 else: 

132 plugin_config = ConfigParser() linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

133 plugin_config.read(options.config_file) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

134 for key in self.__slots__: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

135 setting = plugin_config.getboolean(CONFIGFILE_KEY, key, fallback=False) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

136 setattr(self, key, setting) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

137 

138 

139def from_orm_callback(ctx: MethodContext) -> Type: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

140 """ 

141 Raise an error if orm_mode is not enabled 

142 """ 

143 model_type: Instance 

144 if isinstance(ctx.type, CallableType) and isinstance(ctx.type.ret_type, Instance): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

145 model_type = ctx.type.ret_type # called on the class linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

146 elif isinstance(ctx.type, Instance): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

147 model_type = ctx.type # called on an instance (unusual, but still valid) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

148 else: # pragma: no cover 

149 detail = f'ctx.type: {ctx.type} (of type {ctx.type.__class__.__name__})' 

150 error_unexpected_behavior(detail, ctx.api, ctx.context) 

151 return ctx.default_return_type 

152 pydantic_metadata = model_type.type.metadata.get(METADATA_KEY) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

153 if pydantic_metadata is None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

154 return ctx.default_return_type linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

155 orm_mode = pydantic_metadata.get('config', {}).get('orm_mode') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

156 if orm_mode is not True: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

157 error_from_orm(get_name(model_type.type), ctx.api, ctx.context) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

158 return ctx.default_return_type linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

159 

160 

161class PydanticModelTransformer: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

162 tracked_config_fields: Set[str] = { linux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

163 'extra', 

164 'allow_mutation', 

165 'frozen', 

166 'orm_mode', 

167 'allow_population_by_field_name', 

168 'alias_generator', 

169 } 

170 

171 def __init__(self, ctx: ClassDefContext, plugin_config: PydanticPluginConfig) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

172 self._ctx = ctx linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

173 self.plugin_config = plugin_config linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

174 

175 def transform(self) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

176 """ 

177 Configures the BaseModel subclass according to the plugin settings. 

178 

179 In particular: 

180 * determines the model config and fields, 

181 * adds a fields-aware signature for the initializer and construct methods 

182 * freezes the class if allow_mutation = False or frozen = True 

183 * stores the fields, config, and if the class is settings in the mypy metadata for access by subclasses 

184 """ 

185 ctx = self._ctx linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

186 info = self._ctx.cls.info linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

187 

188 config = self.collect_config() linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

189 fields = self.collect_fields(config) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

190 for field in fields: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

191 if info[field.name].type is None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

192 if not ctx.api.final_iteration: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

193 ctx.api.defer() linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

194 is_settings = any(get_fullname(base) == BASESETTINGS_FULLNAME for base in info.mro[:-1]) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

195 self.add_initializer(fields, config, is_settings) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

196 self.add_construct_method(fields) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

197 self.set_frozen(fields, frozen=config.allow_mutation is False or config.frozen is True) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

198 info.metadata[METADATA_KEY] = { linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

199 'fields': {field.name: field.serialize() for field in fields}, 

200 'config': config.set_values_dict(), 

201 } 

202 

203 def collect_config(self) -> 'ModelConfigData': linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

204 """ 

205 Collects the values of the config attributes that are used by the plugin, accounting for parent classes. 

206 """ 

207 ctx = self._ctx linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

208 cls = ctx.cls linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

209 config = ModelConfigData() linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

210 for stmt in cls.defs.body: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

211 if not isinstance(stmt, ClassDef): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

212 continue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

213 if stmt.name == 'Config': linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

214 for substmt in stmt.defs.body: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

215 if not isinstance(substmt, AssignmentStmt): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

216 continue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

217 config.update(self.get_config_update(substmt)) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

218 if ( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

219 config.has_alias_generator 

220 and not config.allow_population_by_field_name 

221 and self.plugin_config.warn_required_dynamic_aliases 

222 ): 

223 error_required_dynamic_aliases(ctx.api, stmt) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

224 for info in cls.info.mro[1:]: # 0 is the current class linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

225 if METADATA_KEY not in info.metadata: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

226 continue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

227 

228 # Each class depends on the set of fields in its ancestors 

229 ctx.api.add_plugin_dependency(make_wildcard_trigger(get_fullname(info))) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

230 for name, value in info.metadata[METADATA_KEY]['config'].items(): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

231 config.setdefault(name, value) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

232 return config linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

233 

234 def collect_fields(self, model_config: 'ModelConfigData') -> List['PydanticModelField']: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

235 """ 

236 Collects the fields for the model, accounting for parent classes 

237 """ 

238 # First, collect fields belonging to the current class. 

239 ctx = self._ctx linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

240 cls = self._ctx.cls linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

241 fields = [] # type: List[PydanticModelField] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

242 known_fields = set() # type: Set[str] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

243 for stmt in cls.defs.body: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

244 if not isinstance(stmt, AssignmentStmt): # `and stmt.new_syntax` to require annotation linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

245 continue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

246 

247 lhs = stmt.lvalues[0] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

248 if not isinstance(lhs, NameExpr) or not is_valid_field(lhs.name): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

249 continue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

250 

251 if not stmt.new_syntax and self.plugin_config.warn_untyped_fields: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

252 error_untyped_fields(ctx.api, stmt) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

253 

254 # if lhs.name == '__config__': # BaseConfig not well handled; I'm not sure why yet 

255 # continue 

256 

257 sym = cls.info.names.get(lhs.name) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

258 if sym is None: # pragma: no cover linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

259 # This is likely due to a star import (see the dataclasses plugin for a more detailed explanation) 

260 # This is the same logic used in the dataclasses plugin 

261 continue 

262 

263 node = sym.node linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

264 if isinstance(node, PlaceholderNode): # pragma: no cover linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

265 # See the PlaceholderNode docstring for more detail about how this can occur 

266 # Basically, it is an edge case when dealing with complex import logic 

267 # This is the same logic used in the dataclasses plugin 

268 continue 

269 if not isinstance(node, Var): # pragma: no cover linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

270 # Don't know if this edge case still happens with the `is_valid_field` check above 

271 # but better safe than sorry 

272 continue 

273 

274 # x: ClassVar[int] is ignored by dataclasses. 

275 if node.is_classvar: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

276 continue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

277 

278 is_required = self.get_is_required(cls, stmt, lhs) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

279 alias, has_dynamic_alias = self.get_alias_info(stmt) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

280 if ( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

281 has_dynamic_alias 

282 and not model_config.allow_population_by_field_name 

283 and self.plugin_config.warn_required_dynamic_aliases 

284 ): 

285 error_required_dynamic_aliases(ctx.api, stmt) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

286 fields.append( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

287 PydanticModelField( 

288 name=lhs.name, 

289 is_required=is_required, 

290 alias=alias, 

291 has_dynamic_alias=has_dynamic_alias, 

292 line=stmt.line, 

293 column=stmt.column, 

294 ) 

295 ) 

296 known_fields.add(lhs.name) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

297 all_fields = fields.copy() linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

298 for info in cls.info.mro[1:]: # 0 is the current class, -2 is BaseModel, -1 is object linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

299 if METADATA_KEY not in info.metadata: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

300 continue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

301 

302 superclass_fields = [] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

303 # Each class depends on the set of fields in its ancestors 

304 ctx.api.add_plugin_dependency(make_wildcard_trigger(get_fullname(info))) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

305 

306 for name, data in info.metadata[METADATA_KEY]['fields'].items(): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

307 if name not in known_fields: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

308 field = PydanticModelField.deserialize(info, data) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

309 known_fields.add(name) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

310 superclass_fields.append(field) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

311 else: 

312 (field,) = [a for a in all_fields if a.name == name] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

313 all_fields.remove(field) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

314 superclass_fields.append(field) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

315 all_fields = superclass_fields + all_fields linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

316 return all_fields linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

317 

318 def add_initializer(self, fields: List['PydanticModelField'], config: 'ModelConfigData', is_settings: bool) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

319 """ 

320 Adds a fields-aware `__init__` method to the class. 

321 

322 The added `__init__` will be annotated with types vs. all `Any` depending on the plugin settings. 

323 """ 

324 ctx = self._ctx linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

325 typed = self.plugin_config.init_typed linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

326 use_alias = config.allow_population_by_field_name is not True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

327 force_all_optional = is_settings or bool( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

328 config.has_alias_generator and not config.allow_population_by_field_name 

329 ) 

330 init_arguments = self.get_field_arguments( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

331 fields, typed=typed, force_all_optional=force_all_optional, use_alias=use_alias 

332 ) 

333 if not self.should_init_forbid_extra(fields, config): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

334 var = Var('kwargs') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

335 init_arguments.append(Argument(var, AnyType(TypeOfAny.explicit), None, ARG_STAR2)) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

336 add_method(ctx, '__init__', init_arguments, NoneType()) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

337 

338 def add_construct_method(self, fields: List['PydanticModelField']) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

339 """ 

340 Adds a fully typed `construct` classmethod to the class. 

341 

342 Similar to the fields-aware __init__ method, but always uses the field names (not aliases), 

343 and does not treat settings fields as optional. 

344 """ 

345 ctx = self._ctx linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

346 set_str = ctx.api.named_type(f'{BUILTINS_NAME}.set', [ctx.api.named_type(f'{BUILTINS_NAME}.str')]) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

347 optional_set_str = UnionType([set_str, NoneType()]) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

348 fields_set_argument = Argument(Var('_fields_set', optional_set_str), optional_set_str, None, ARG_OPT) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

349 construct_arguments = self.get_field_arguments(fields, typed=True, force_all_optional=False, use_alias=False) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

350 construct_arguments = [fields_set_argument] + construct_arguments linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

351 

352 obj_type = ctx.api.named_type(f'{BUILTINS_NAME}.object') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

353 self_tvar_name = '_PydanticBaseModel' # Make sure it does not conflict with other names in the class linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

354 tvar_fullname = ctx.cls.fullname + '.' + self_tvar_name linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

355 tvd = TypeVarDef(self_tvar_name, tvar_fullname, -1, [], obj_type) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

356 self_tvar_expr = TypeVarExpr(self_tvar_name, tvar_fullname, [], obj_type) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

357 ctx.cls.info.names[self_tvar_name] = SymbolTableNode(MDEF, self_tvar_expr) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

358 

359 # Backward-compatible with TypeVarDef from Mypy 0.910. 

360 if isinstance(tvd, TypeVarType): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

361 self_type = tvd linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

362 else: 

363 self_type = TypeVarType(tvd) # type: ignore[call-arg] linux-py3.10-mypy0.910

364 

365 add_method( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

366 ctx, 

367 'construct', 

368 construct_arguments, 

369 return_type=self_type, 

370 self_type=self_type, 

371 tvar_def=tvd, 

372 is_classmethod=True, 

373 ) 

374 

375 def set_frozen(self, fields: List['PydanticModelField'], frozen: bool) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

376 """ 

377 Marks all fields as properties so that attempts to set them trigger mypy errors. 

378 

379 This is the same approach used by the attrs and dataclasses plugins. 

380 """ 

381 info = self._ctx.cls.info linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

382 for field in fields: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

383 sym_node = info.names.get(field.name) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

384 if sym_node is not None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

385 var = sym_node.node linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

386 assert isinstance(var, Var) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

387 var.is_property = frozen linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

388 else: 

389 var = field.to_var(info, use_alias=False) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

390 var.info = info linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

391 var.is_property = frozen linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

392 var._fullname = get_fullname(info) + '.' + get_name(var) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

393 info.names[get_name(var)] = SymbolTableNode(MDEF, var) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

394 

395 def get_config_update(self, substmt: AssignmentStmt) -> Optional['ModelConfigData']: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

396 """ 

397 Determines the config update due to a single statement in the Config class definition. 

398 

399 Warns if a tracked config attribute is set to a value the plugin doesn't know how to interpret (e.g., an int) 

400 """ 

401 lhs = substmt.lvalues[0] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

402 if not (isinstance(lhs, NameExpr) and lhs.name in self.tracked_config_fields): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

403 return None linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

404 if lhs.name == 'extra': linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

405 if isinstance(substmt.rvalue, StrExpr): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

406 forbid_extra = substmt.rvalue.value == 'forbid' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

407 elif isinstance(substmt.rvalue, MemberExpr): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

408 forbid_extra = substmt.rvalue.name == 'forbid' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

409 else: 

410 error_invalid_config_value(lhs.name, self._ctx.api, substmt) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

411 return None linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

412 return ModelConfigData(forbid_extra=forbid_extra) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

413 if lhs.name == 'alias_generator': linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

414 has_alias_generator = True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

415 if isinstance(substmt.rvalue, NameExpr) and substmt.rvalue.fullname == 'builtins.None': linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

416 has_alias_generator = False linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

417 return ModelConfigData(has_alias_generator=has_alias_generator) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

418 if isinstance(substmt.rvalue, NameExpr) and substmt.rvalue.fullname in ('builtins.True', 'builtins.False'): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

419 return ModelConfigData(**{lhs.name: substmt.rvalue.fullname == 'builtins.True'}) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

420 error_invalid_config_value(lhs.name, self._ctx.api, substmt) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

421 return None linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

422 

423 @staticmethod linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

424 def get_is_required(cls: ClassDef, stmt: AssignmentStmt, lhs: NameExpr) -> bool: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

425 """ 

426 Returns a boolean indicating whether the field defined in `stmt` is a required field. 

427 """ 

428 expr = stmt.rvalue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

429 if isinstance(expr, TempNode): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

430 # TempNode means annotation-only, so only non-required if Optional 

431 value_type = get_proper_type(cls.info[lhs.name].type) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

432 if isinstance(value_type, UnionType) and any(isinstance(item, NoneType) for item in value_type.items): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

433 # Annotated as Optional, or otherwise having NoneType in the union 

434 return False linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

435 return True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

436 if isinstance(expr, CallExpr) and isinstance(expr.callee, RefExpr) and expr.callee.fullname == FIELD_FULLNAME: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

437 # The "default value" is a call to `Field`; at this point, the field is 

438 # only required if default is Ellipsis (i.e., `field_name: Annotation = Field(...)`) 

439 return len(expr.args) > 0 and expr.args[0].__class__ is EllipsisExpr linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

440 # Only required if the "default value" is Ellipsis (i.e., `field_name: Annotation = ...`) 

441 return isinstance(expr, EllipsisExpr) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

442 

443 @staticmethod linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

444 def get_alias_info(stmt: AssignmentStmt) -> Tuple[Optional[str], bool]: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

445 """ 

446 Returns a pair (alias, has_dynamic_alias), extracted from the declaration of the field defined in `stmt`. 

447 

448 `has_dynamic_alias` is True if and only if an alias is provided, but not as a string literal. 

449 If `has_dynamic_alias` is True, `alias` will be None. 

450 """ 

451 expr = stmt.rvalue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

452 if isinstance(expr, TempNode): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

453 # TempNode means annotation-only 

454 return None, False linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

455 

456 if not ( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

457 isinstance(expr, CallExpr) and isinstance(expr.callee, RefExpr) and expr.callee.fullname == FIELD_FULLNAME 

458 ): 

459 # Assigned value is not a call to pydantic.fields.Field 

460 return None, False linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

461 

462 for i, arg_name in enumerate(expr.arg_names): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

463 if arg_name != 'alias': linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

464 continue linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

465 arg = expr.args[i] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

466 if isinstance(arg, StrExpr): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

467 return arg.value, False linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

468 else: 

469 return None, True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

470 return None, False linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

471 

472 def get_field_arguments( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

473 self, fields: List['PydanticModelField'], typed: bool, force_all_optional: bool, use_alias: bool 

474 ) -> List[Argument]: 

475 """ 

476 Helper function used during the construction of the `__init__` and `construct` method signatures. 

477 

478 Returns a list of mypy Argument instances for use in the generated signatures. 

479 """ 

480 info = self._ctx.cls.info linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

481 arguments = [ linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

482 field.to_argument(info, typed=typed, force_optional=force_all_optional, use_alias=use_alias) 

483 for field in fields 

484 if not (use_alias and field.has_dynamic_alias) 

485 ] 

486 return arguments linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

487 

488 def should_init_forbid_extra(self, fields: List['PydanticModelField'], config: 'ModelConfigData') -> bool: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

489 """ 

490 Indicates whether the generated `__init__` should get a `**kwargs` at the end of its signature 

491 

492 We disallow arbitrary kwargs if the extra config setting is "forbid", or if the plugin config says to, 

493 *unless* a required dynamic alias is present (since then we can't determine a valid signature). 

494 """ 

495 if not config.allow_population_by_field_name: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

496 if self.is_dynamic_alias_present(fields, bool(config.has_alias_generator)): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

497 return False linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

498 if config.forbid_extra: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

499 return True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

500 return self.plugin_config.init_forbid_extra linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

501 

502 @staticmethod linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

503 def is_dynamic_alias_present(fields: List['PydanticModelField'], has_alias_generator: bool) -> bool: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

504 """ 

505 Returns whether any fields on the model have a "dynamic alias", i.e., an alias that cannot be 

506 determined during static analysis. 

507 """ 

508 for field in fields: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

509 if field.has_dynamic_alias: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

510 return True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

511 if has_alias_generator: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

512 for field in fields: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

513 if field.alias is None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

514 return True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

515 return False linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

516 

517 

518class PydanticModelField: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

519 def __init__( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

520 self, name: str, is_required: bool, alias: Optional[str], has_dynamic_alias: bool, line: int, column: int 

521 ): 

522 self.name = name linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

523 self.is_required = is_required linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

524 self.alias = alias linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

525 self.has_dynamic_alias = has_dynamic_alias linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

526 self.line = line linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

527 self.column = column linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

528 

529 def to_var(self, info: TypeInfo, use_alias: bool) -> Var: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

530 name = self.name linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

531 if use_alias and self.alias is not None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

532 name = self.alias linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

533 return Var(name, info[self.name].type) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

534 

535 def to_argument(self, info: TypeInfo, typed: bool, force_optional: bool, use_alias: bool) -> Argument: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

536 if typed and info[self.name].type is not None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

537 type_annotation = info[self.name].type linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

538 else: 

539 type_annotation = AnyType(TypeOfAny.explicit) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

540 return Argument( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

541 variable=self.to_var(info, use_alias), 

542 type_annotation=type_annotation, 

543 initializer=None, 

544 kind=ARG_NAMED_OPT if force_optional or not self.is_required else ARG_NAMED, 

545 ) 

546 

547 def serialize(self) -> JsonDict: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

548 return self.__dict__ linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

549 

550 @classmethod linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

551 def deserialize(cls, info: TypeInfo, data: JsonDict) -> 'PydanticModelField': linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

552 return cls(**data) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

553 

554 

555class ModelConfigData: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

556 def __init__( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

557 self, 

558 forbid_extra: Optional[bool] = None, 

559 allow_mutation: Optional[bool] = None, 

560 frozen: Optional[bool] = None, 

561 orm_mode: Optional[bool] = None, 

562 allow_population_by_field_name: Optional[bool] = None, 

563 has_alias_generator: Optional[bool] = None, 

564 ): 

565 self.forbid_extra = forbid_extra linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

566 self.allow_mutation = allow_mutation linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

567 self.frozen = frozen linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

568 self.orm_mode = orm_mode linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

569 self.allow_population_by_field_name = allow_population_by_field_name linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

570 self.has_alias_generator = has_alias_generator linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

571 

572 def set_values_dict(self) -> Dict[str, Any]: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

573 return {k: v for k, v in self.__dict__.items() if v is not None} linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

574 

575 def update(self, config: Optional['ModelConfigData']) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

576 if config is None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

577 return linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

578 for k, v in config.set_values_dict().items(): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

579 setattr(self, k, v) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

580 

581 def setdefault(self, key: str, value: Any) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

582 if getattr(self, key) is None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

583 setattr(self, key, value) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

584 

585 

586ERROR_ORM = ErrorCode('pydantic-orm', 'Invalid from_orm call', 'Pydantic') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

587ERROR_CONFIG = ErrorCode('pydantic-config', 'Invalid config value', 'Pydantic') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

588ERROR_ALIAS = ErrorCode('pydantic-alias', 'Dynamic alias disallowed', 'Pydantic') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

589ERROR_UNEXPECTED = ErrorCode('pydantic-unexpected', 'Unexpected behavior', 'Pydantic') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

590ERROR_UNTYPED = ErrorCode('pydantic-field', 'Untyped field disallowed', 'Pydantic') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

591 

592 

593def error_from_orm(model_name: str, api: CheckerPluginInterface, context: Context) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

594 api.fail(f'"{model_name}" does not have orm_mode=True', context, code=ERROR_ORM) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

595 

596 

597def error_invalid_config_value(name: str, api: SemanticAnalyzerPluginInterface, context: Context) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

598 api.fail(f'Invalid value for "Config.{name}"', context, code=ERROR_CONFIG) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

599 

600 

601def error_required_dynamic_aliases(api: SemanticAnalyzerPluginInterface, context: Context) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

602 api.fail('Required dynamic aliases disallowed', context, code=ERROR_ALIAS) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

603 

604 

605def error_unexpected_behavior(detail: str, api: CheckerPluginInterface, context: Context) -> None: # pragma: no cover linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

606 # Can't think of a good way to test this, but I confirmed it renders as desired by adding to a non-error path 

607 link = 'https://github.com/samuelcolvin/pydantic/issues/new/choose' 

608 full_message = f'The pydantic mypy plugin ran into unexpected behavior: {detail}\n' 

609 full_message += f'Please consider reporting this bug at {link} so we can try to fix it!' 

610 api.fail(full_message, context, code=ERROR_UNEXPECTED) 

611 

612 

613def error_untyped_fields(api: SemanticAnalyzerPluginInterface, context: Context) -> None: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

614 api.fail('Untyped fields disallowed', context, code=ERROR_UNTYPED) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

615 

616 

617def add_method( linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

618 ctx: ClassDefContext, 

619 name: str, 

620 args: List[Argument], 

621 return_type: Type, 

622 self_type: Optional[Type] = None, 

623 tvar_def: Optional[TypeVarDef] = None, 

624 is_classmethod: bool = False, 

625 is_new: bool = False, 

626 # is_staticmethod: bool = False, 

627) -> None: 

628 """ 

629 Adds a new method to a class. 

630 

631 This can be dropped if/when https://github.com/python/mypy/issues/7301 is merged 

632 """ 

633 info = ctx.cls.info linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

634 

635 # First remove any previously generated methods with the same name 

636 # to avoid clashes and problems in the semantic analyzer. 

637 if name in info.names: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

638 sym = info.names[name] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

639 if sym.plugin_generated and isinstance(sym.node, FuncDef): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

640 ctx.cls.defs.body.remove(sym.node) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

641 

642 self_type = self_type or fill_typevars(info) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

643 if is_classmethod or is_new: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

644 first = [Argument(Var('_cls'), TypeType.make_normalized(self_type), None, ARG_POS)] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

645 # elif is_staticmethod: 

646 # first = [] 

647 else: 

648 self_type = self_type or fill_typevars(info) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

649 first = [Argument(Var('__pydantic_self__'), self_type, None, ARG_POS)] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

650 args = first + args linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

651 arg_types, arg_names, arg_kinds = [], [], [] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

652 for arg in args: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

653 assert arg.type_annotation, 'All arguments must be fully typed.' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

654 arg_types.append(arg.type_annotation) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

655 arg_names.append(get_name(arg.variable)) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

656 arg_kinds.append(arg.kind) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

657 

658 function_type = ctx.api.named_type(f'{BUILTINS_NAME}.function') linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

659 signature = CallableType(arg_types, arg_kinds, arg_names, return_type, function_type) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

660 if tvar_def: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

661 signature.variables = [tvar_def] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

662 

663 func = FuncDef(name, args, Block([PassStmt()])) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

664 func.info = info linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

665 func.type = set_callable_name(signature, func) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

666 func.is_class = is_classmethod linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

667 # func.is_static = is_staticmethod 

668 func._fullname = get_fullname(info) + '.' + name linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

669 func.line = info.line linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

670 

671 # NOTE: we would like the plugin generated node to dominate, but we still 

672 # need to keep any existing definitions so they get semantically analyzed. 

673 if name in info.names: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

674 # Get a nice unique name instead. 

675 r_name = get_unique_redefinition_name(name, info.names) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

676 info.names[r_name] = info.names[name] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

677 

678 if is_classmethod: # or is_staticmethod: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

679 func.is_decorated = True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

680 v = Var(name, func.type) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

681 v.info = info linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

682 v._fullname = func._fullname linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

683 # if is_classmethod: 

684 v.is_classmethod = True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

685 dec = Decorator(func, [NameExpr('classmethod')], v) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

686 # else: 

687 # v.is_staticmethod = True 

688 # dec = Decorator(func, [NameExpr('staticmethod')], v) 

689 

690 dec.line = info.line linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

691 sym = SymbolTableNode(MDEF, dec) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

692 else: 

693 sym = SymbolTableNode(MDEF, func) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

694 sym.plugin_generated = True linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

695 

696 info.names[name] = sym linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

697 info.defn.defs.body.append(func) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

698 

699 

700def get_fullname(x: Union[FuncBase, SymbolNode]) -> str: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

701 """ 

702 Used for compatibility with mypy 0.740; can be dropped once support for 0.740 is dropped. 

703 """ 

704 fn = x.fullname linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

705 if callable(fn): # pragma: no cover linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

706 return fn() 

707 return fn linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

708 

709 

710def get_name(x: Union[FuncBase, SymbolNode]) -> str: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

711 """ 

712 Used for compatibility with mypy 0.740; can be dropped once support for 0.740 is dropped. 

713 """ 

714 fn = x.name linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

715 if callable(fn): # pragma: no cover linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

716 return fn() 

717 return fn linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

718 

719 

720def parse_toml(config_file: str) -> Optional[Dict[str, Any]]: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

721 if not config_file.endswith('.toml'): linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

722 return None linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

723 

724 read_mode = 'rb' linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

725 try: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

726 import tomli as toml_ linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

727 except ImportError: linux-py3.10-mypy0.910

728 # older versions of mypy have toml as a dependency, not tomli 

729 read_mode = 'r' linux-py3.10-mypy0.910

730 try: linux-py3.10-mypy0.910

731 import toml as toml_ # type: ignore[no-redef] linux-py3.10-mypy0.910

732 except ImportError: # pragma: no cover 

733 import warnings 

734 

735 warnings.warn('No TOML parser installed, cannot read configuration from `pyproject.toml`.') 

736 return None 

737 

738 with open(config_file, read_mode) as rf: linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

739 return toml_.load(rf) # type: ignore[arg-type] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10