Skip to content

Commit f87aa30

Browse files
authored
Update mypy to 1.11.0 (#642)
1 parent 7fd015a commit f87aa30

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def find_stub_files(name: str) -> List[str]:
2929

3030
# Keep compatible-mypy major.minor version pinned to what latest django-stubs release uses.
3131
extras_require = {
32-
"compatible-mypy": ["mypy~=1.10.0", "django-stubs[compatible-mypy]"],
32+
"compatible-mypy": ["mypy~=1.11.0", "django-stubs[compatible-mypy]"],
3333
"coreapi": ["coreapi>=2.0.0"],
3434
"markdown": ["types-Markdown>=0.1.5"],
3535
}

tests/typecheck/test_fields.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
from typing import Optional, Dict, Any
5252
5353
CharField(initial='', default=lambda: '')
54-
CharField(initial=None, default=4) # E: Argument "default" to "CharField" has incompatible type "int"; expected "Union[Union[str, _StrPromise], Callable[[], Union[str, _StrPromise]], None, _Empty]"
55-
CharField(initial={}, default=empty) # E: Argument "initial" to "CharField" has incompatible type "Dict[Never, Never]"; expected "Union[str, Callable[[], str], None, _Empty]"
54+
CharField(initial=None, default=4) # E: Argument "default" to "CharField" has incompatible type "int"; expected "Union[Union[str, _StrPromise], Callable[[], Union[str, _StrPromise]], _Empty, None]"
55+
CharField(initial={}, default=empty) # E: Argument "initial" to "CharField" has incompatible type "Dict[Never, Never]"; expected "Union[str, Callable[[], str], _Empty, None]"
5656
5757
x: Optional[str] = CharField().get_initial()
5858
y: Optional[int] = CharField().get_initial() # E: Incompatible types in assignment (expression has type "Optional[str]", variable has type "Optional[int]")
@@ -76,7 +76,7 @@
7676
ChoiceField(['test'], allow_null=True, default=None)
7777
ChoiceField([1], default=int_callback)
7878
ChoiceField([1, 'lulz'], default=mixed_callback)
79-
ChoiceField([1], default=lambda: None) # E: Argument "default" to "ChoiceField" has incompatible type "Callable[[], None]"; expected "Union[Union[str, _StrPromise], int, Callable[[], Union[Union[str, _StrPromise], int]], None, _Empty]" # E: Incompatible return value type (got "None", expected "Union[Union[str, _StrPromise], int]")
79+
ChoiceField([1], default=lambda: None) # E: Argument "default" to "ChoiceField" has incompatible type "Callable[[], None]"; expected "Union[Union[str, _StrPromise], int, Callable[[], Union[Union[str, _StrPromise], int]], _Empty, None]" # E: Incompatible return value type (got "None", expected "Union[Union[str, _StrPromise], int]")
8080
8181
- case: MultipleChoiceField_default
8282
main: |
@@ -90,13 +90,13 @@
9090
MultipleChoiceField(choices=['test'], allow_null=True, default=None)
9191
MultipleChoiceField(choices=[1], default=int_set_callback)
9292
MultipleChoiceField(choices=[1, 'lulz'], default=mixed_set_callback)
93-
MultipleChoiceField(choices=[1], default=lambda: [1]) # E: Argument "default" to "MultipleChoiceField" has incompatible type "Callable[[], List[int]]"; expected "Union[Set[Union[str, int]], Set[str], Set[int], Callable[[], Union[Set[Union[str, int]], Set[str], Set[int]]], None, _Empty]" # E: Incompatible return value type (got "List[int]", expected "Union[Set[Union[str, int]], Set[str], Set[int]]")
93+
MultipleChoiceField(choices=[1], default=lambda: [1]) # E: Argument "default" to "MultipleChoiceField" has incompatible type "Callable[[], List[int]]"; expected "Union[Set[Union[str, int]], Set[str], Set[int], Callable[[], Union[Set[Union[str, int]], Set[str], Set[int]]], _Empty, None]" # E: Incompatible return value type (got "List[int]", expected "Union[Set[Union[str, int]], Set[str], Set[int]]")
9494
9595
MultipleChoiceField(choices=[(1, "1"), (2, "2")], default={1})
96-
MultipleChoiceField(choices=[(1, "1"), (2, "2")], default=[1]) # E: Argument "default" to "MultipleChoiceField" has incompatible type "List[int]"; expected "Union[Set[Union[str, int]], Set[str], Set[int], Callable[[], Union[Set[Union[str, int]], Set[str], Set[int]]], None, _Empty]"
96+
MultipleChoiceField(choices=[(1, "1"), (2, "2")], default=[1]) # E: Argument "default" to "MultipleChoiceField" has incompatible type "List[int]"; expected "Union[Set[Union[str, int]], Set[str], Set[int], Callable[[], Union[Set[Union[str, int]], Set[str], Set[int]]], _Empty, None]"
9797
9898
MultipleChoiceField(choices=[(1, "1"), (2, "2")], initial={1})
99-
MultipleChoiceField(choices=[(1, "1"), (2, "2")], initial=[1]) # E: Argument "initial" to "MultipleChoiceField" has incompatible type "List[int]"; expected "Union[Set[Union[Union[str, _StrPromise], int]], Set[Union[str, _StrPromise]], Set[int], Callable[[], Union[Set[Union[Union[str, _StrPromise], int]], Set[Union[str, _StrPromise]], Set[int]]], None, _Empty]"
99+
MultipleChoiceField(choices=[(1, "1"), (2, "2")], initial=[1]) # E: Argument "initial" to "MultipleChoiceField" has incompatible type "List[int]"; expected "Union[Set[Union[Union[str, _StrPromise], int]], Set[Union[str, _StrPromise]], Set[int], Callable[[], Union[Set[Union[Union[str, _StrPromise], int]], Set[Union[str, _StrPromise]], Set[int]]], _Empty, None]"
100100
101101
- case: FileField_default
102102
main: |
@@ -108,12 +108,12 @@
108108
FileField(allow_null=True, default=None)
109109
FileField(allow_null=True, default=file_callback)
110110
FileField(allow_null=True, default=file_callback())
111-
FileField(allow_null=True, default=123) # E: Argument "default" to "FileField" has incompatible type "int"; expected "Union[File[Any], Callable[[], File[Any]], None, _Empty]"
111+
FileField(allow_null=True, default=123) # E: Argument "default" to "FileField" has incompatible type "int"; expected "Union[File[Any], Callable[[], File[Any]], _Empty, None]"
112112
113113
ImageField(allow_null=True, default=None)
114114
ImageField(default=file_callback)
115115
ImageField(default=file_callback())
116-
ImageField(default='a') # E: Argument "default" to "ImageField" has incompatible type "str"; expected "Union[File[Any], Callable[[], File[Any]], None, _Empty]"
116+
ImageField(default='a') # E: Argument "default" to "ImageField" has incompatible type "str"; expected "Union[File[Any], Callable[[], File[Any]], _Empty, None]"
117117
118118
- case: DictField_default
119119
main: |
@@ -123,13 +123,13 @@
123123
DictField(default={})
124124
DictField(default={'a': 1, 'b': 2})
125125
DictField(default=lambda: {'a': [], 'b': 'str'})
126-
DictField(default=[]) # E: Argument "default" to "DictField" has incompatible type "List[Never]"; expected "Union[Dict[Any, Any], Callable[[], Dict[Any, Any]], None, _Empty]"
126+
DictField(default=[]) # E: Argument "default" to "DictField" has incompatible type "List[Never]"; expected "Union[Dict[Any, Any], Callable[[], Dict[Any, Any]], _Empty, None]"
127127
128128
JSONField(allow_null=True, default=None)
129129
JSONField(default={})
130130
JSONField(default={'a': 1, 'b': 2})
131131
JSONField(default=lambda: {'a': [], 'b': 'str'})
132-
JSONField(default=[]) # E: Argument "default" to "JSONField" has incompatible type "List[Never]"; expected "Union[Mapping[Any, Any], Callable[[], Mapping[Any, Any]], None, _Empty]"
132+
JSONField(default=[]) # E: Argument "default" to "JSONField" has incompatible type "List[Never]"; expected "Union[Mapping[Any, Any], Callable[[], Mapping[Any, Any]], _Empty, None]"
133133
134134
- case: ListField_default
135135
main: |
@@ -139,4 +139,4 @@
139139
ListField(default=[])
140140
ListField(default=[0, 'one'])
141141
ListField(default=lambda: [])
142-
ListField(default='wät') # E: Argument "default" to "ListField" has incompatible type "str"; expected "Union[List[Any], Callable[[], List[Any]], None, _Empty]"
142+
ListField(default='wät') # E: Argument "default" to "ListField" has incompatible type "str"; expected "Union[List[Any], Callable[[], List[Any]], _Empty, None]"

0 commit comments

Comments
 (0)