Skip to content

Commit 1735d9e

Browse files
[pre-commit.ci] pre-commit autoupdate (#1923)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 47b9bac commit 1735d9e

File tree

15 files changed

+27
-21
lines changed

15 files changed

+27
-21
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
- id: ruff
1919
args: ["--fix", "--exit-non-zero-on-fix"]
2020
- repo: https://github.com/psf/black
21-
rev: 23.12.1
21+
rev: 24.1.1
2222
hooks:
2323
- id: black
2424
- repo: https://github.com/codespell-project/codespell

django-stubs/contrib/auth/base_user.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class AbstractBaseUser(models.Model):
2222

2323
class Meta:
2424
abstract: Literal[True]
25+
2526
def get_username(self) -> str: ...
2627
def natural_key(self) -> tuple[str]: ...
2728
@property

django-stubs/contrib/auth/models.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class PermissionsMixin(models.Model):
6363

6464
class Meta:
6565
abstract: Literal[True]
66+
6667
def get_user_permissions(self, obj: _AnyUser | None = ...) -> set[str]: ...
6768
def get_group_permissions(self, obj: _AnyUser | None = ...) -> set[str]: ...
6869
def get_all_permissions(self, obj: _AnyUser | None = ...) -> set[str]: ...
@@ -88,6 +89,7 @@ class AbstractUser(AbstractBaseUser, PermissionsMixin):
8889

8990
class Meta:
9091
abstract: Literal[True]
92+
9193
def get_full_name(self) -> str: ...
9294
def get_short_name(self) -> str: ...
9395
def email_user(

django-stubs/contrib/gis/db/backends/oracle/models.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class OracleGeometryColumns(models.Model):
1515
app_label: str
1616
db_table: str
1717
managed: bool
18+
1819
@classmethod
1920
def table_name_col(cls) -> Any: ...
2021
@classmethod
@@ -33,5 +34,6 @@ class OracleSpatialRefSys(models.Model, SpatialRefSysMixin):
3334
app_label: str
3435
db_table: str
3536
managed: bool
37+
3638
@property
3739
def wkt(self) -> Any: ...

django-stubs/contrib/gis/db/backends/postgis/models.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class PostGISGeometryColumns(models.Model):
1818
app_label: str
1919
db_table: str
2020
managed: bool
21+
2122
@classmethod
2223
def table_name_col(cls) -> Any: ...
2324
@classmethod
@@ -35,5 +36,6 @@ class PostGISSpatialRefSys(models.Model, SpatialRefSysMixin):
3536
app_label: str
3637
db_table: str
3738
managed: bool
39+
3840
@property
3941
def wkt(self) -> Any: ...

django-stubs/contrib/gis/db/backends/spatialite/models.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class SpatialiteGeometryColumns(models.Model):
1717
app_label: str
1818
db_table: str
1919
managed: bool
20+
2021
@classmethod
2122
def table_name_col(cls) -> Any: ...
2223
@classmethod
@@ -35,5 +36,6 @@ class SpatialiteSpatialRefSys(models.Model, SpatialRefSysMixin):
3536
app_label: str
3637
db_table: str
3738
managed: bool
39+
3840
@property
3941
def wkt(self) -> Any: ...

django-stubs/contrib/gis/forms/widgets.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class OpenLayersWidget(BaseGeometryWidget):
2626
class Media:
2727
css: Any
2828
js: Any
29+
2930
def serialize(self, value: Any) -> Any: ...
3031
def deserialize(self, value: Any) -> Any: ...
3132

django-stubs/contrib/sessions/base_session.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class AbstractBaseSession(models.Model):
1818

1919
class Meta:
2020
abstract: Literal[True]
21+
2122
@classmethod
2223
def get_session_store_class(cls) -> type[SessionBase] | None: ...
2324
def get_decoded(self) -> dict[str, Any]: ...

django-stubs/db/migrations/recorder.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class MigrationRecorder:
1212
name: Any
1313
applied: Any
1414
objects: ClassVar[Manager[Self]]
15+
1516
connection: BaseDatabaseWrapper
1617
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
1718
@property

django-stubs/db/models/sql/compiler.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ class SQLCompiler:
3131
col_count: int | None
3232
def setup_query(self, with_col_aliases: bool = ...) -> None: ...
3333
has_extra_select: Any
34-
def pre_sql_setup(
35-
self, with_col_aliases: bool = ...
36-
) -> tuple[
34+
def pre_sql_setup(self, with_col_aliases: bool = ...) -> tuple[
3735
list[tuple[Expression, _AsSqlType, None]],
3836
list[tuple[Expression, tuple[str, _ParamsT, bool]]],
3937
list[_AsSqlType],

django-stubs/forms/forms.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class DeclarativeFieldsMetaclass(MediaDefiningClass): ...
1515
class BaseForm(RenderableFormMixin):
1616
class Meta:
1717
fields: Sequence[str]
18+
1819
default_renderer: BaseRenderer | type[BaseRenderer] | None
1920
field_order: Iterable[str] | None
2021
use_required_attribute: bool

django-stubs/utils/http.pyi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ RFC3986_GENDELIMS: str
1010
RFC3986_SUBDELIMS: str
1111

1212
def urlencode(
13-
query: Mapping[str, str | bytes | int | Iterable[str | bytes | int]]
14-
| Iterable[tuple[str, str | bytes | int | Iterable[str | bytes | int]]]
15-
| None,
13+
query: (
14+
Mapping[str, str | bytes | int | Iterable[str | bytes | int]]
15+
| Iterable[tuple[str, str | bytes | int | Iterable[str | bytes | int]]]
16+
| None
17+
),
1618
doseq: bool = ...,
1719
) -> str: ...
1820
def http_date(epoch_seconds: float | None = ...) -> str: ...

ext/django_stubs_ext/db/router.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,15 @@ class TypedDatabaseRouter:
1414
Django documentation: https://docs.djangoproject.com/en/stable/topics/db/multi-db/#automatic-database-routing
1515
"""
1616

17-
def db_for_read(self, model: Type[Model], **hints: Any) -> Optional[str]:
18-
...
17+
def db_for_read(self, model: Type[Model], **hints: Any) -> Optional[str]: ...
1918

20-
def db_for_write(self, model: Type[Model], **hints: Any) -> Optional[str]:
21-
...
19+
def db_for_write(self, model: Type[Model], **hints: Any) -> Optional[str]: ...
2220

23-
def allow_relation(self, obj1: Type[Model], obj2: Type[Model], **hints: Any) -> Optional[bool]:
24-
...
21+
def allow_relation(self, obj1: Type[Model], obj2: Type[Model], **hints: Any) -> Optional[bool]: ...
2522

2623
def allow_migrate(
2724
self, db: str, app_label: str, model_name: Optional[str] = None, **hints: Any
28-
) -> Optional[bool]:
29-
...
25+
) -> Optional[bool]: ...
3026

3127
else:
3228
TypedDatabaseRouter = object

ext/django_stubs_ext/types.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
# Used internally by mypy_django_plugin.
55
class AnyAttrAllowed(Protocol):
6-
def __getattr__(self, item: str) -> Any:
7-
...
6+
def __getattr__(self, item: str) -> Any: ...
87

9-
def __setattr__(self, item: str, value: Any) -> None:
10-
...
8+
def __setattr__(self, item: str, value: Any) -> None: ...

ext/tests/test_monkeypatching.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ def __call__(
2121
django_version: Optional[_VersionSpec] = None,
2222
extra_classes: Optional[Iterable[type]] = None,
2323
include_builtins: bool = True,
24-
) -> None:
25-
...
24+
) -> None: ...
2625

2726

2827
@pytest.fixture(scope="function")

0 commit comments

Comments
 (0)