diff --git a/django-stubs/db/models/enums.pyi b/django-stubs/db/models/enums.pyi index a13dc7c81..e511a4f01 100644 --- a/django-stubs/db/models/enums.pyi +++ b/django-stubs/db/models/enums.pyi @@ -17,9 +17,9 @@ else: _enum_property = property EnumType = enum.EnumMeta - class ReprEnum(enum.Enum): ... - class IntEnum(int, ReprEnum): ... - class StrEnum(str, ReprEnum): ... + class ReprEnum(enum.Enum): ... # type: ignore[misc] + class IntEnum(int, ReprEnum): ... # type: ignore[misc] + class StrEnum(str, ReprEnum): ... # type: ignore[misc] @deprecated("ChoicesMeta is deprecated in favor of ChoicesType and will be removed in Django 6.0.") class ChoicesMeta(EnumType): @@ -42,7 +42,7 @@ class ChoicesMeta(EnumType): ChoicesType: TypeAlias = ChoicesMeta -class Choices(enum.Enum, metaclass=ChoicesType): +class Choices(enum.Enum, metaclass=ChoicesType): # type: ignore[misc] @property def label(self) -> str: ... @_enum_property @@ -61,7 +61,7 @@ class _IntegerChoicesMeta(ChoicesType): # In reality, the `__init__` overloads provided below should also support # all the arguments of `int.__new__`/`str.__new__` (e.g. `base`, `encoding`). # They are omitted on purpose to avoid having convoluted stubs for these enums: -class IntegerChoices(Choices, IntEnum, metaclass=_IntegerChoicesMeta): +class IntegerChoices(Choices, IntEnum, metaclass=_IntegerChoicesMeta): # type: ignore[misc] @overload def __init__(self, x: ConvertibleToInt) -> None: ... @overload @@ -77,7 +77,7 @@ class _TextChoicesMeta(ChoicesType): @property def values(self) -> list[str]: ... -class TextChoices(Choices, StrEnum, metaclass=_TextChoicesMeta): +class TextChoices(Choices, StrEnum, metaclass=_TextChoicesMeta): # type: ignore[misc] @overload def __init__(self, object: str) -> None: ... @overload diff --git a/requirements.txt b/requirements.txt index 9f300e3fa..df6c714eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,5 +12,5 @@ Django==5.1.4; python_version >= '3.10' -e .[redis,compatible-mypy,oracle] # Overrides: -mypy==1.13.0 +mypy==1.14.0 pyright==1.1.391 diff --git a/scripts/stubtest/allowlist_todo.txt b/scripts/stubtest/allowlist_todo.txt index 2f295d4b1..24f85454a 100644 --- a/scripts/stubtest/allowlist_todo.txt +++ b/scripts/stubtest/allowlist_todo.txt @@ -1302,3 +1302,75 @@ django.db.models.expressions.rhs django.db.models.expressions.result django.db.models.expressions.lhs django.db.backends.postgresql.base.Cursor + +# mypy 1.14.0 new issues: +django.apps.__all__ +django.conf.urls.__all__ +django.contrib.admin.__all__ +django.contrib.gis.admin.__all__ +django.contrib.gis.db.models.__all__ +django.contrib.gis.db.models.aggregates.__all__ +django.contrib.gis.db.models.sql.__all__ +django.contrib.gis.gdal.__all__ +django.contrib.gis.geoip2.__all__ +django.contrib.gis.geos.io.__all__ +django.contrib.gis.geos.prototypes.misc.__all__ +django.contrib.gis.measure.__all__ +django.contrib.gis.sitemaps.__all__ +django.contrib.gis.utils.__all__ +django.contrib.messages.api.__all__ +django.contrib.postgres.aggregates.general.__all__ +django.contrib.postgres.aggregates.statistics.__all__ +django.contrib.postgres.constraints.__all__ +django.contrib.postgres.fields.array.__all__ +django.contrib.postgres.fields.citext.__all__ +django.contrib.postgres.fields.hstore.__all__ +django.contrib.postgres.fields.jsonb.__all__ +django.contrib.postgres.fields.ranges.__all__ +django.contrib.postgres.forms.hstore.__all__ +django.contrib.postgres.forms.ranges.__all__ +django.contrib.postgres.indexes.__all__ +django.core.cache.__all__ +django.core.checks.__all__ +django.core.files.locks.__all__ +django.core.files.move.__all__ +django.core.files.storage.memory.__all__ +django.core.files.temp.__all__ +django.core.files.uploadedfile.__all__ +django.core.files.uploadhandler.__all__ +django.core.mail.__all__ +django.core.servers.basehttp.__all__ +django.db.__all__ +django.db.migrations.operations.__all__ +django.db.models.__all__ +django.db.models.aggregates.__all__ +django.db.models.constraints.__all__ +django.db.models.enums.__all__ +django.db.models.fields.__all__ +django.db.models.fields.generated.__all__ +django.db.models.fields.json.__all__ +django.db.models.functions.__all__ +django.db.models.functions.window.__all__ +django.db.models.indexes.__all__ +django.db.models.sql.__all__ +django.db.models.sql.query.__all__ +django.db.models.sql.subqueries.__all__ +django.forms.boundfield.__all__ +django.forms.fields.__all__ +django.forms.forms.__all__ +django.forms.formsets.__all__ +django.forms.models.__all__ +django.forms.widgets.__all__ +django.http.__all__ +django.http.multipartparser.__all__ +django.template.__all__ +django.test.__all__ +django.test.client.__all__ +django.test.testcases.__all__ +django.test.utils.__all__ +django.urls.__all__ +django.utils.choices.__all__ +django.utils.timezone.__all__ +django.utils.translation.__all__ +django.views.__all__ +django.views.generic.__all__ diff --git a/setup.py b/setup.py index 37c046639..395e2947e 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,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.12,<1.14"], + "compatible-mypy": ["mypy>=1.12,<1.15"], "redis": ["redis"], "oracle": ["oracledb"], } diff --git a/tests/typecheck/fields/test_base.yml b/tests/typecheck/fields/test_base.yml index 42f20966d..40bab2593 100644 --- a/tests/typecheck/fields/test_base.yml +++ b/tests/typecheck/fields/test_base.yml @@ -27,7 +27,7 @@ booking = Booking() reveal_type(booking.id) # N: Revealed type is "builtins.int" reveal_type(booking.time_range) # N: Revealed type is "Any" - reveal_type(booking.some_decimal) # N: Revealed type is "_decimal.Decimal" + reveal_type(booking.some_decimal) # N: Revealed type is "decimal.Decimal" installed_apps: - myapp files: diff --git a/tests/typecheck/managers/test_managers.yml b/tests/typecheck/managers/test_managers.yml index e111ca63c..4abf6368e 100644 --- a/tests/typecheck/managers/test_managers.yml +++ b/tests/typecheck/managers/test_managers.yml @@ -680,8 +680,8 @@ installed_apps: - myapp out: | - main:2: note: Revealed type is "myapp.models.MyModel.MyManager" - main:3: note: Revealed type is "Any" + main:2: note: Revealed type is "myapp.models.MyModel.MyManager[myapp.models.MyModel]" + main:3: note: Revealed type is "myapp.models.MyModel" files: - path: myapp/__init__.py - path: myapp/models.py