Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mypy, add a bit more metadata #1997

Merged
merged 5 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ We rely on different `django` and `mypy` versions:

| django-stubs | Mypy version | Django version | Django partial support | Python version |
|----------------|--------------|----------------|------------------------|----------------|
| (next release) | 1.8.x | 5.0 | 4.2, 4.1 | 3.8 - 3.12 |
| (next release) | 1.9.x | 5.0 | 4.2, 4.1 | 3.8 - 3.12 |
| 4.2.7 | 1.7.x | 4.2 | 4.1, 3.2 | 3.8 - 3.12 |
| 4.2.6 | 1.6.x | 4.2 | 4.1, 3.2 | 3.8 - 3.12 |
| 4.2.5 | 1.6.x | 4.2 | 4.1, 3.2 | 3.8 - 3.12 |
Expand Down
22 changes: 1 addition & 21 deletions django-stubs/core/mail/message.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from collections.abc import Sequence
from email import charset as Charset
from email._policybase import Policy
from email.message import Message
from email.mime.base import MIMEBase
from email.mime.message import MIMEMessage
Expand All @@ -27,30 +25,13 @@ class MIMEMixin:
def as_string(self, unixfrom: bool = ..., linesep: str = ...) -> str: ...
def as_bytes(self, unixfrom: bool = ..., linesep: str = ...) -> bytes: ...

class SafeMIMEMessage(MIMEMixin, MIMEMessage): # type: ignore[misc]
defects: list[Any]
epilogue: Any
policy: Policy
preamble: Any
def __setitem__(self, name: str, val: str) -> None: ...
class SafeMIMEMessage(MIMEMixin, MIMEMessage): ... # type: ignore[misc]

class SafeMIMEText(MIMEMixin, MIMEText): # type: ignore[misc]
defects: list[Any]
epilogue: None
policy: Policy
preamble: None
encoding: str
def __init__(self, _text: str, _subtype: str = ..., _charset: str = ...) -> None: ...
def __setitem__(self, name: str, val: str) -> None: ...
def set_payload(
self, payload: list[Message] | str | bytes, charset: str | Charset.Charset | None = ...
) -> None: ...

class SafeMIMEMultipart(MIMEMixin, MIMEMultipart): # type: ignore[misc]
defects: list[Any]
epilogue: None
policy: Policy
preamble: None
encoding: str
def __init__(
self,
Expand All @@ -60,7 +41,6 @@ class SafeMIMEMultipart(MIMEMixin, MIMEMultipart): # type: ignore[misc]
encoding: str = ...,
**_params: Any,
) -> None: ...
def __setitem__(self, name: str, val: str) -> None: ...

_AttachmentContent: TypeAlias = bytes | EmailMessage | Message | SafeMIMEText | str
_AttachmentTuple: TypeAlias = (
Expand Down
3 changes: 1 addition & 2 deletions ext/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
license_files=["LICENSE.md"],
url="https://github.com/typeddjango/django-stubs",
author="Simula Proxy",
author_email="[email protected]",
maintainer="Marti Raudsepp",
maintainer_email="[email protected]",
py_modules=[],
Expand All @@ -41,12 +40,12 @@
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
],
project_urls={
"Funding": "https://github.com/sponsors/typeddjango",
"Release notes": "https://github.com/typeddjango/django-stubs/releases",
},
)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Django==5.0.3; python_version >= '3.10'
-e .[compatible-mypy]

# Overrides:
mypy==1.8.0
mypy==1.9.0
9 changes: 6 additions & 3 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ django.contrib.gis.db.models.PositiveIntegerField.integer_field_class
django.contrib.gis.db.models.PositiveSmallIntegerField.formfield
django.contrib.gis.db.models.PositiveSmallIntegerField.integer_field_class
django.contrib.gis.db.models.Q.XOR
django.contrib.gis.db.models.Q.__init__
django.contrib.gis.db.models.Q.check
django.contrib.gis.db.models.Q.flatten
django.contrib.gis.db.models.Q.resolve_expression
Expand Down Expand Up @@ -970,7 +969,6 @@ django.db.models.PositiveIntegerField.integer_field_class
django.db.models.PositiveSmallIntegerField.formfield
django.db.models.PositiveSmallIntegerField.integer_field_class
django.db.models.Q.XOR
django.db.models.Q.__init__
django.db.models.Q.check
django.db.models.Q.flatten
django.db.models.Q.resolve_expression
Expand Down Expand Up @@ -1364,7 +1362,6 @@ django.db.models.query.prefetch_one_level
django.db.models.query_utils.DeferredAttribute.__get__
django.db.models.query_utils.InvalidQuery
django.db.models.query_utils.Q.XOR
django.db.models.query_utils.Q.__init__
django.db.models.query_utils.Q.check
django.db.models.query_utils.Q.flatten
django.db.models.query_utils.Q.resolve_expression
Expand Down Expand Up @@ -1673,3 +1670,9 @@ django.urls.path
django.urls.re_path
django.urls.resolvers.LocaleRegexDescriptor.__get__
django.urls.resolvers.ResolverMatch.__iter__

# mypy 1.9.0 new issues:
django.db.models.expressions.rhs
django.db.models.expressions.result
django.db.models.expressions.lhs
django.db.backends.postgresql.base.Cursor
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.0"],
"compatible-mypy": ["mypy~=1.9.0"],
}

setup(
Expand Down Expand Up @@ -66,12 +66,12 @@ def find_stub_files(name: str) -> List[str]:
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
],
project_urls={
"Funding": "https://github.com/sponsors/typeddjango",
"Release notes": "https://github.com/typeddjango/django-stubs/releases",
},
)