diff --git a/README.md b/README.md index 4d3875a26..8b122aa91 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ We rely on different `django` and `mypy` versions: | django-stubs | Mypy version | Django version | Django partial support | Python version | |----------------|--------------|----------------|------------------------|----------------| +| 5.0.3 | 1.11.x | 5.0 | 4.2 | 3.8 - 3.12 | | 5.0.2 | 1.10.x | 5.0 | 4.2 | 3.8 - 3.12 | | 5.0.1 | 1.10.x | 5.0 | 4.2 | 3.8 - 3.12 | | 5.0.0 | 1.10.x | 5.0 | 4.2, 4.1 | 3.8 - 3.12 | diff --git a/django-stubs/contrib/admin/utils.pyi b/django-stubs/contrib/admin/utils.pyi index 521f8a9da..811f86f28 100644 --- a/django-stubs/contrib/admin/utils.pyi +++ b/django-stubs/contrib/admin/utils.pyi @@ -75,7 +75,7 @@ def lookup_field( name: Callable | str, obj: Model, model_admin: BaseModelAdmin | None = ... ) -> tuple[Field | None, str | None, Any]: ... @overload -def label_for_field( # type: ignore[overload-overlap] +def label_for_field( name: Callable | str, model: type[Model], model_admin: BaseModelAdmin | None = ..., diff --git a/django-stubs/db/models/sql/compiler.pyi b/django-stubs/db/models/sql/compiler.pyi index b000631be..16ace84fb 100644 --- a/django-stubs/db/models/sql/compiler.pyi +++ b/django-stubs/db/models/sql/compiler.pyi @@ -98,7 +98,7 @@ class SQLCompiler: ) -> Iterator[Sequence[Any]]: ... def has_results(self) -> bool: ... @overload - def execute_sql( # type: ignore[overload-overlap] + def execute_sql( self, result_type: Literal["cursor"] = ..., chunked_fetch: bool = ..., chunk_size: int = ... ) -> CursorWrapper: ... @overload @@ -106,7 +106,7 @@ class SQLCompiler: self, result_type: Literal["no results"] | None = ..., chunked_fetch: bool = ..., chunk_size: int = ... ) -> None: ... @overload - def execute_sql( # type: ignore[overload-overlap] + def execute_sql( self, result_type: Literal["single"] = ..., chunked_fetch: bool = ..., chunk_size: int = ... ) -> Iterable[Sequence[Any]] | None: ... @overload diff --git a/django-stubs/forms/models.pyi b/django-stubs/forms/models.pyi index fab91bc9a..5e41fc930 100644 --- a/django-stubs/forms/models.pyi +++ b/django-stubs/forms/models.pyi @@ -306,7 +306,7 @@ class ModelMultipleChoiceField(ModelChoiceField[_M]): def modelform_defines_fields(form_class: type[ModelForm]) -> bool: ... @overload -def _get_foreign_key( # type: ignore[overload-overlap] +def _get_foreign_key( parent_model: type[Model], model: type[Model], fk_name: str | None = ..., can_fail: Literal[True] = ... ) -> ForeignKey | None: ... @overload diff --git a/django-stubs/utils/encoding.pyi b/django-stubs/utils/encoding.pyi index c8df836d7..f8bd12113 100644 --- a/django-stubs/utils/encoding.pyi +++ b/django-stubs/utils/encoding.pyi @@ -60,7 +60,7 @@ def iri_to_uri(iri: None) -> None: ... @overload def iri_to_uri(iri: str | Promise) -> str: ... @overload -def uri_to_iri(uri: None) -> None: ... # type: ignore[overload-overlap] +def uri_to_iri(uri: None) -> None: ... @overload def uri_to_iri(uri: Any) -> str: ... def escape_uri_path(path: str) -> str: ... diff --git a/django-stubs/utils/formats.pyi b/django-stubs/utils/formats.pyi index e2182a19b..784ad967c 100644 --- a/django-stubs/utils/formats.pyi +++ b/django-stubs/utils/formats.pyi @@ -30,15 +30,11 @@ _T = TypeVar("_T") # details it works as expected (all values from Union are `localize`d to str, # while type of others is preserved) @overload -def localize( # type: ignore[overload-overlap] - value: builtin_datetime | date | time | Decimal | float | str, use_l10n: bool | None = ... -) -> str: ... +def localize(value: builtin_datetime | date | time | Decimal | float | str, use_l10n: bool | None = ...) -> str: ... @overload def localize(value: _T, use_l10n: bool | None = ...) -> _T: ... @overload -def localize_input( # type: ignore[overload-overlap] - value: builtin_datetime | date | time | Decimal | float | str, default: str | None = ... -) -> str: ... +def localize_input(value: builtin_datetime | date | time | Decimal | float | str, default: str | None = ...) -> str: ... @overload def localize_input(value: _T, default: str | None = ...) -> _T: ... def sanitize_separators(value: _T) -> _T: ... diff --git a/requirements.txt b/requirements.txt index 8bca9aed5..d226b6934 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,5 +14,5 @@ Django==5.0.7; python_version >= '3.10' -e .[redis,compatible-mypy,oracle] # Overrides: -mypy==1.10.1 +mypy==1.11.0 pyright==1.1.373 diff --git a/setup.py b/setup.py index 845bf0b63..66043d480 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def find_stub_files(name: str) -> List[str]: # Keep compatible-mypy major.minor version pinned to what we use in CI (requirements.txt) extras_require = { - "compatible-mypy": ["mypy~=1.10.0"], + "compatible-mypy": ["mypy~=1.11.0"], "redis": ["redis"], "oracle": ["oracledb"], } diff --git a/tests/typecheck/contrib/admin/test_decorators.yml b/tests/typecheck/contrib/admin/test_decorators.yml index e43f4a993..405695507 100644 --- a/tests/typecheck/contrib/admin/test_decorators.yml +++ b/tests/typecheck/contrib/admin/test_decorators.yml @@ -17,7 +17,7 @@ @admin.display def display_property(self) -> str: ... - @admin.display # E: Decorators on top of @property are not supported [misc] + @admin.display # E: Decorators on top of @property are not supported [prop-decorator] @property def incorrect_property(self) -> str: ...