Skip to content

Commit 2017cee

Browse files
authored
Merge branch 'master' into feat/builtin-models-types
2 parents 2d76dc5 + c37850b commit 2017cee

File tree

161 files changed

+1911
-777
lines changed

Some content is hidden

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

161 files changed

+1911
-777
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
python-version: ${{ matrix.python-version }}
3131
- name: Install dependencies
3232
run: |
33-
pip install -U pip setuptools wheel
33+
pip install -U pip "setuptools<79.0.0" wheel
3434
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt
3535
3636
- name: Run mypy on plugin code
@@ -63,7 +63,7 @@ jobs:
6363
python-version: ${{ matrix.python-version }}
6464
- name: Install dependencies
6565
run: |
66-
pip install -U pip setuptools wheel
66+
pip install -U pip "setuptools<79.0.0" wheel
6767
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt
6868
6969
# Must match `shard` definition in the test matrix:
@@ -91,7 +91,7 @@ jobs:
9191
python-version: ${{ matrix.python-version }}
9292
- name: Install dependencies
9393
run: |
94-
pip install -U pip setuptools wheel
94+
pip install -U pip "setuptools<79.0.0" wheel
9595
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt
9696
9797
- name: Run stubtest
@@ -112,7 +112,7 @@ jobs:
112112
python-version: ${{ matrix.python-version }}
113113
- name: Install dependencies
114114
run: |
115-
pip install -U pip setuptools wheel
115+
pip install -U pip "setuptools<79.0.0" wheel
116116
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt
117117
- name: Run pyright on the stubs
118118
uses: jakebailey/pyright-action@v2
@@ -146,7 +146,7 @@ jobs:
146146
python-version: ${{ matrix.python-version }}
147147
- name: Install dependencies
148148
run: |
149-
pip install -U pip setuptools wheel
149+
pip install -U pip "setuptools<79.0.0" wheel
150150
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt
151151
pip install "Django==${{ matrix.django-version }}"
152152
pip check

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
args: [--fix=lf]
1818
- id: check-case-conflict
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.11.4
20+
rev: v0.11.7
2121
hooks:
2222
- id: ruff
2323
args: ["--fix", "--exit-non-zero-on-fix"]

README.md

Lines changed: 1 addition & 0 deletions
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.2.0 | 1.13+ | 5.2 | 5.1 | 3.10 - 3.13 |
5253
| 5.1.3 | 1.13+ | 5.1 | 4.2 | 3.9 - 3.13 |
5354
| 5.1.2 | 1.13+ | 5.1 | 4.2 | 3.9 - 3.13 |
5455
| 5.1.1 | 1.13.x | 5.1 | 4.2 | 3.8 - 3.12 |

django-stubs/apps/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
from .config import AppConfig as AppConfig
22
from .registry import apps as apps
3+
4+
__all__ = ["AppConfig", "apps"]

django-stubs/contrib/admin/__init__.pyi

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,28 @@ from .sites import AdminSite as AdminSite
2222
from .sites import site as site
2323

2424
def autodiscover() -> None: ...
25+
26+
__all__ = [
27+
"action",
28+
"display",
29+
"register",
30+
"ModelAdmin",
31+
"HORIZONTAL",
32+
"VERTICAL",
33+
"StackedInline",
34+
"TabularInline",
35+
"AdminSite",
36+
"site",
37+
"ListFilter",
38+
"SimpleListFilter",
39+
"FieldListFilter",
40+
"BooleanFieldListFilter",
41+
"RelatedFieldListFilter",
42+
"ChoicesFieldListFilter",
43+
"DateFieldListFilter",
44+
"AllValuesFieldListFilter",
45+
"EmptyFieldListFilter",
46+
"RelatedOnlyFieldListFilter",
47+
"ShowFacets",
48+
"autodiscover",
49+
]

django-stubs/contrib/admin/templatetags/admin_list.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ from django.utils.safestring import SafeString
1313
from .base import InclusionAdminNode
1414

1515
register: Any
16-
DOT: str
1716

1817
def paginator_number(cl: ChangeList, i: int) -> SafeString: ...
1918
def pagination(cl: ChangeList) -> dict[str, Any]: ...

django-stubs/contrib/admin/tests.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ class AdminSeleniumTestCase(SeleniumTestCase, StaticLiveServerTestCase):
2323
def deselect_option(self, selector: str, value: Any) -> None: ...
2424
def assertSelectOptions(self, selector: str, values: Any) -> None: ...
2525
def assertSelectedOptions(self, selector: str, values: Any) -> None: ...
26-
def has_css_class(self, selector: str, klass: str) -> bool: ...
26+
def is_disabled(self, selector: str) -> bool: ...

django-stubs/contrib/admin/utils.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def label_for_field(
9393
form: BaseForm | None = ...,
9494
) -> str: ...
9595
def help_text_for_field(name: str, model: type[Model]) -> str: ...
96-
def display_for_field(value: Any, field: Field, empty_value_display: str) -> str: ...
96+
def display_for_field(value: Any, field: Field, empty_value_display: str, avoid_link: bool = False) -> str: ...
9797
def display_for_value(value: Any, empty_value_display: str, boolean: bool = ...) -> str: ...
9898

9999
class NotRelationField(Exception): ...

django-stubs/contrib/admin/widgets.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ class AdminUUIDInputWidget(forms.TextInput):
133133

134134
SELECT2_TRANSLATIONS: dict[str, str]
135135

136+
def get_select2_language() -> str | None: ...
137+
136138
class AutocompleteMixin:
137139
url_name: str
138140
field: Any

django-stubs/contrib/admindocs/utils.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from collections.abc import Callable
2+
from re import Pattern
23
from typing import Any
34

45
from django.utils.safestring import SafeString
@@ -10,7 +11,9 @@ def parse_docstring(docstring: str) -> tuple[str, str, dict[str, str]]: ...
1011
def parse_rst(text: str, default_reference_context: Any, thing_being_parsed: Any | None = ...) -> SafeString: ...
1112

1213
ROLES: dict[str, str]
14+
explicit_title_re: Pattern[str]
1315

16+
def split_explicit_title(text: str) -> tuple[bool, str, str]: ...
1417
def create_reference_role(rolename: str, urlbase: str) -> None: ...
1518
def default_reference_role(
1619
name: str,
@@ -27,3 +30,4 @@ unnamed_group_matcher: Any
2730

2831
def replace_named_groups(pattern: str) -> str: ...
2932
def replace_unnamed_groups(pattern: str) -> str: ...
33+
def strip_p_tags(value: str) -> SafeString: ...

0 commit comments

Comments
 (0)