Skip to content

Commit 5fbe861

Browse files
Update mypy to 1.11.0 (#2269)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0022c59 commit 5fbe861

File tree

9 files changed

+11
-14
lines changed

9 files changed

+11
-14
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ We rely on different `django` and `mypy` versions:
4949

5050
| django-stubs | Mypy version | Django version | Django partial support | Python version |
5151
|----------------|--------------|----------------|------------------------|----------------|
52+
| 5.0.3 | 1.11.x | 5.0 | 4.2 | 3.8 - 3.12 |
5253
| 5.0.2 | 1.10.x | 5.0 | 4.2 | 3.8 - 3.12 |
5354
| 5.0.1 | 1.10.x | 5.0 | 4.2 | 3.8 - 3.12 |
5455
| 5.0.0 | 1.10.x | 5.0 | 4.2, 4.1 | 3.8 - 3.12 |

django-stubs/contrib/admin/utils.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def lookup_field(
7575
name: Callable | str, obj: Model, model_admin: BaseModelAdmin | None = ...
7676
) -> tuple[Field | None, str | None, Any]: ...
7777
@overload
78-
def label_for_field( # type: ignore[overload-overlap]
78+
def label_for_field(
7979
name: Callable | str,
8080
model: type[Model],
8181
model_admin: BaseModelAdmin | None = ...,

django-stubs/db/models/sql/compiler.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ class SQLCompiler:
9898
) -> Iterator[Sequence[Any]]: ...
9999
def has_results(self) -> bool: ...
100100
@overload
101-
def execute_sql( # type: ignore[overload-overlap]
101+
def execute_sql(
102102
self, result_type: Literal["cursor"] = ..., chunked_fetch: bool = ..., chunk_size: int = ...
103103
) -> CursorWrapper: ...
104104
@overload
105105
def execute_sql(
106106
self, result_type: Literal["no results"] | None = ..., chunked_fetch: bool = ..., chunk_size: int = ...
107107
) -> None: ...
108108
@overload
109-
def execute_sql( # type: ignore[overload-overlap]
109+
def execute_sql(
110110
self, result_type: Literal["single"] = ..., chunked_fetch: bool = ..., chunk_size: int = ...
111111
) -> Iterable[Sequence[Any]] | None: ...
112112
@overload

django-stubs/forms/models.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class ModelMultipleChoiceField(ModelChoiceField[_M]):
306306

307307
def modelform_defines_fields(form_class: type[ModelForm]) -> bool: ...
308308
@overload
309-
def _get_foreign_key( # type: ignore[overload-overlap]
309+
def _get_foreign_key(
310310
parent_model: type[Model], model: type[Model], fk_name: str | None = ..., can_fail: Literal[True] = ...
311311
) -> ForeignKey | None: ...
312312
@overload

django-stubs/utils/encoding.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def iri_to_uri(iri: None) -> None: ...
6060
@overload
6161
def iri_to_uri(iri: str | Promise) -> str: ...
6262
@overload
63-
def uri_to_iri(uri: None) -> None: ... # type: ignore[overload-overlap]
63+
def uri_to_iri(uri: None) -> None: ...
6464
@overload
6565
def uri_to_iri(uri: Any) -> str: ...
6666
def escape_uri_path(path: str) -> str: ...

django-stubs/utils/formats.pyi

+2-6
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,11 @@ _T = TypeVar("_T")
3030
# details it works as expected (all values from Union are `localize`d to str,
3131
# while type of others is preserved)
3232
@overload
33-
def localize( # type: ignore[overload-overlap]
34-
value: builtin_datetime | date | time | Decimal | float | str, use_l10n: bool | None = ...
35-
) -> str: ...
33+
def localize(value: builtin_datetime | date | time | Decimal | float | str, use_l10n: bool | None = ...) -> str: ...
3634
@overload
3735
def localize(value: _T, use_l10n: bool | None = ...) -> _T: ...
3836
@overload
39-
def localize_input( # type: ignore[overload-overlap]
40-
value: builtin_datetime | date | time | Decimal | float | str, default: str | None = ...
41-
) -> str: ...
37+
def localize_input(value: builtin_datetime | date | time | Decimal | float | str, default: str | None = ...) -> str: ...
4238
@overload
4339
def localize_input(value: _T, default: str | None = ...) -> _T: ...
4440
def sanitize_separators(value: _T) -> _T: ...

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ Django==5.0.7; python_version >= '3.10'
1414
-e .[redis,compatible-mypy,oracle]
1515

1616
# Overrides:
17-
mypy==1.10.1
17+
mypy==1.11.0
1818
pyright==1.1.373

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def find_stub_files(name: str) -> List[str]:
3232

3333
# Keep compatible-mypy major.minor version pinned to what we use in CI (requirements.txt)
3434
extras_require = {
35-
"compatible-mypy": ["mypy~=1.10.0"],
35+
"compatible-mypy": ["mypy~=1.11.0"],
3636
"redis": ["redis"],
3737
"oracle": ["oracledb"],
3838
}

tests/typecheck/contrib/admin/test_decorators.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@admin.display
1818
def display_property(self) -> str: ...
1919
20-
@admin.display # E: Decorators on top of @property are not supported [misc]
20+
@admin.display # E: Decorators on top of @property are not supported [prop-decorator]
2121
@property
2222
def incorrect_property(self) -> str: ...
2323

0 commit comments

Comments
 (0)