Skip to content

Commit cac4ba8

Browse files
authored
Prepare for 5.2.9 release (without Django 6.0 changes) (#2995)
* Revert "Remove useless decorators from `main/django/contrib/auth/admin.py` (#2986)" This reverts commit 6915b64. * Revert "Add `SetPasswordMixin.__class_getitem__` (#2985)" This reverts commit f788f6c. * Revert "Django 6.0.1 (#2984)" This reverts commit 46c1675 * Revert "Django 6.0: Add Django Tasks framework (#2967)" This reverts commit b962b71. * Revert "Django 6.0: require kwargs for optional parameters in EmailMessage (#2975)" This reverts commit 4e2deb1. * Revert "Fix missing `__del__` (#2974)" This reverts commit a936349 * Revert "Add hints support to postgres extension classes (#2972)" This reverts commit cc934a7. * Revert "Django 6.0: require kwargs for optional parameters in mail functions (#2966)" This reverts commit f1f9653. * Revert "Add stubs for django.contrib.postgres.search.Lexeme (#2961)" This reverts commit fea872d. * Revert "Add stubs for django.db.models.StringAgg and Aggregate order_by fields (#2960)" This reverts commit 22ef63a. * Revert "Django 6.0: Add `databases=` parameter to `check_generic_foreign_keys`, `check_model_name_lengths` (#2951)" This reverts commit a579836 * Revert "Django 6.0: Add stubs for built-in CSP support (#2931)" This reverts commit 51beeee. * Revert "Django 6.0: Add Model.NotUpdated & ObjectNotUpdated exceptions (#2940)" This reverts commit b38eaf4. * Revert "Tests: Update to Django 6.0; fall back to 5.2 on Python <3.12 (#2939)" This reverts commit 5adea71 * Revert "Django 6.0: update ADMINS and MANAGERS setting type (#2965)" This reverts commit 833d035.
1 parent 897617a commit cac4ba8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+133
-722
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ jobs:
205205
matrix:
206206
python-version: ['3.10', '3.11', '3.12', '3.13']
207207
django-version: ['5.0', '5.1', '5.2']
208-
include:
209-
- python-version: '3.12'
210-
django-version: '6.0'
211-
- python-version: '3.13'
212-
django-version: '6.0'
213208
steps:
214209
- uses: actions/checkout@v6
215210
- name: Setup system dependencies

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
.pytest_cache/
77
.ruff_cache/
88
.venv/
9-
venv/
109
__pycache__/
1110
django-source/
1211
out/

django-stubs/conf/global_settings.pyi

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from collections.abc import Collection, Mapping, Sequence
1+
from collections.abc import Sequence
22
from re import Pattern
33

44
# This is defined here as a do-nothing function because we can't import
@@ -10,9 +10,7 @@ from typing_extensions import NotRequired
1010

1111
from django_stubs_ext.settings import TemplatesSetting
1212

13-
# Note: the tuple element format for ADMINS or MANAGERS is deprecated. Use a
14-
# list of strings instead.
15-
_Admins: TypeAlias = list[str] | list[tuple[str, str]]
13+
_Admins: TypeAlias = list[tuple[str, str]]
1614

1715
####################
1816
# CORE #
@@ -543,9 +541,3 @@ SECURE_REDIRECT_EXEMPT: list[str]
543541
SECURE_REFERRER_POLICY: str
544542
SECURE_SSL_HOST: str | None
545543
SECURE_SSL_REDIRECT: bool
546-
547-
##################
548-
# CSP MIDDLEWARE #
549-
##################
550-
SECURE_CSP: Mapping[str, Collection[str] | str]
551-
SECURE_CSP_REPORT_ONLY: Mapping[str, Collection[str] | str]

django-stubs/contrib/auth/admin.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ from django.http.response import HttpResponse
77

88
_AbstractUserT = TypeVar("_AbstractUserT", bound=AbstractUser)
99

10+
csrf_protect_m: Any
11+
sensitive_post_parameters_m: Any
12+
1013
class GroupAdmin(admin.ModelAdmin[Group]): ...
1114

1215
class UserAdmin(admin.ModelAdmin[_AbstractUserT]):

django-stubs/contrib/auth/forms.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class SetPasswordMixin(Generic[_UserType]):
4545
def set_password_and_save(
4646
self, user: _UserType, password_field_name: str = "password1", commit: bool = True
4747
) -> _UserType: ...
48-
def __class_getitem__(cls, *args: Any, **kwargs: Any) -> Any: ...
4948

5049
class SetUnusablePasswordMixin(Generic[_UserType]):
5150
usable_password_help_text: _StrOrPromise

django-stubs/contrib/contenttypes/checks.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@ from typing import Any
44
from django.apps.config import AppConfig
55
from django.core.checks.messages import CheckMessage
66

7-
def check_generic_foreign_keys(
8-
app_configs: Sequence[AppConfig] | None, *, databases: Sequence[str] | None = ..., **kwargs: Any
9-
) -> list[CheckMessage]: ...
10-
def check_model_name_lengths(
11-
app_configs: Sequence[AppConfig] | None, *, databases: Sequence[str] | None = ..., **kwargs: Any
12-
) -> list[CheckMessage]: ...
7+
def check_generic_foreign_keys(app_configs: Sequence[AppConfig] | None = None, **kwargs: Any) -> list[CheckMessage]: ...
8+
def check_model_name_lengths(app_configs: Sequence[AppConfig] | None = None, **kwargs: Any) -> list[CheckMessage]: ...

django-stubs/contrib/postgres/operations.pyi

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
1-
from typing import Any
2-
31
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
42
from django.db.migrations import AddConstraint, AddIndex, RemoveIndex
53
from django.db.migrations.operations.base import Operation
64

75
class CreateExtension(Operation):
86
name: str
9-
hints: dict[str, Any]
10-
def __init__(self, name: str, hints: dict[str, Any] | None = None) -> None: ...
7+
def __init__(self, name: str) -> None: ...
118
def extension_exists(self, schema_editor: BaseDatabaseSchemaEditor, extension: str) -> bool: ...
129

1310
class BloomExtension(CreateExtension):
14-
def __init__(self, hints: dict[str, Any] | None = None) -> None: ...
11+
def __init__(self) -> None: ...
1512

1613
class BtreeGinExtension(CreateExtension):
17-
def __init__(self, hints: dict[str, Any] | None = None) -> None: ...
14+
def __init__(self) -> None: ...
1815

1916
class BtreeGistExtension(CreateExtension):
20-
def __init__(self, hints: dict[str, Any] | None = None) -> None: ...
17+
def __init__(self) -> None: ...
2118

2219
class CITextExtension(CreateExtension):
23-
def __init__(self, hints: dict[str, Any] | None = None) -> None: ...
20+
def __init__(self) -> None: ...
2421

2522
class CryptoExtension(CreateExtension):
26-
def __init__(self, hints: dict[str, Any] | None = None) -> None: ...
23+
def __init__(self) -> None: ...
2724

2825
class HStoreExtension(CreateExtension):
29-
def __init__(self, hints: dict[str, Any] | None = None) -> None: ...
26+
def __init__(self) -> None: ...
3027

3128
class TrigramExtension(CreateExtension):
32-
def __init__(self, hints: dict[str, Any] | None = None) -> None: ...
29+
def __init__(self) -> None: ...
3330

3431
class UnaccentExtension(CreateExtension):
35-
def __init__(self, hints: dict[str, Any] | None = None) -> None: ...
32+
def __init__(self) -> None: ...
3633

3734
class NotInTransactionMixin:
3835
def _ensure_not_in_transaction(self, schema_editor: BaseDatabaseSchemaEditor) -> None: ...

django-stubs/contrib/postgres/search.pyi

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ from typing import Any, ClassVar, TypeAlias
22

33
from django.db.backends.base.base import BaseDatabaseWrapper
44
from django.db.models import Expression, Field, FloatField, TextField
5-
from django.db.models.expressions import Combinable, CombinedExpression, Func, Value
5+
from django.db.models.expressions import Combinable, CombinedExpression, Func
66
from django.db.models.lookups import Lookup
77
from django.db.models.sql.compiler import SQLCompiler, _AsSqlType
88
from typing_extensions import Self
@@ -142,16 +142,3 @@ class TrigramWordDistance(TrigramWordBase): ...
142142
class TrigramStrictWordDistance(TrigramWordBase): ...
143143
class TrigramWordSimilarity(TrigramWordBase): ...
144144
class TrigramStrictWordSimilarity(TrigramWordBase): ...
145-
146-
class Lexeme(Value):
147-
def __init__(
148-
self,
149-
value: Any,
150-
output_field: Any | None = None,
151-
*,
152-
invert: bool = False,
153-
prefix: bool = False,
154-
weight: Any | None = None,
155-
) -> None: ...
156-
157-
class CombinedLexeme(CombinedExpression): ...

django-stubs/core/exceptions.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class AppRegistryNotReady(Exception): ...
99
class ObjectDoesNotExist(Exception):
1010
silent_variable_failure: bool
1111

12-
class ObjectNotUpdated(Exception): ...
1312
class MultipleObjectsReturned(Exception): ...
1413
class SuspiciousOperation(Exception): ...
1514
class SuspiciousMultipartForm(SuspiciousOperation): ...

django-stubs/core/mail/__init__.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ from .message import make_msgid as make_msgid
1616
from .utils import DNS_NAME as DNS_NAME
1717
from .utils import CachedDnsName as CachedDnsName
1818

19-
def get_connection(backend: str | None = None, *, fail_silently: bool = False, **kwds: Any) -> Any: ...
19+
def get_connection(backend: str | None = None, fail_silently: bool = False, **kwds: Any) -> Any: ...
2020
def send_mail(
2121
subject: _StrOrPromise,
2222
message: _StrOrPromise,
2323
from_email: str | None,
2424
recipient_list: Sequence[str],
25-
*,
2625
fail_silently: bool = False,
2726
auth_user: str | None = None,
2827
auth_password: str | None = None,
@@ -31,7 +30,6 @@ def send_mail(
3130
) -> int: ...
3231
def send_mass_mail(
3332
datatuple: Iterable[tuple[str, str, str | None, list[str]]],
34-
*,
3533
fail_silently: bool = False,
3634
auth_user: str | None = None,
3735
auth_password: str | None = None,
@@ -40,15 +38,13 @@ def send_mass_mail(
4038
def mail_admins(
4139
subject: _StrOrPromise,
4240
message: _StrOrPromise,
43-
*,
4441
fail_silently: bool = False,
4542
connection: Any | None = None,
4643
html_message: str | None = None,
4744
) -> None: ...
4845
def mail_managers(
4946
subject: _StrOrPromise,
5047
message: _StrOrPromise,
51-
*,
5248
fail_silently: bool = False,
5349
connection: Any | None = None,
5450
html_message: str | None = None,

0 commit comments

Comments
 (0)