Skip to content

Commit

Permalink
I checked the mypy issue, suppressions aren't needed in these contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
intgr committed Jun 5, 2023
1 parent 79dc858 commit a7cb888
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
rev: v0.0.269
hooks:
- id: ruff
args: ["--fix", "--fixable=I001,F401", "--exit-non-zero-on-fix"]
args: ["--fix", "--fixable=I001,F401,UP", "--exit-non-zero-on-fix"]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
Expand Down
11 changes: 2 additions & 9 deletions django-stubs/contrib/admin/options.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from typing import ( # noqa: Y037 # https://github.com/python/mypy/issues/12211
Any,
Generic,
Literal,
Optional,
TypeVar,
Union,
)
from typing import Any, Generic, Literal, TypeVar, Union # noqa: Y037 # https://github.com/python/mypy/issues/12211

from django import forms
from django.contrib.admin.filters import FieldListFilter, ListFilter
Expand Down Expand Up @@ -88,7 +81,7 @@ class BaseModelAdmin(Generic[_ModelT]):
raw_id_fields: Sequence[str]
fields: _FieldGroups | None
exclude: Sequence[str] | None
fieldsets: Optional[_FieldsetSpec] # noqa: UP007
fieldsets: _FieldsetSpec | None
form: type[forms.ModelForm[_ModelT]]
filter_vertical: Sequence[str]
filter_horizontal: Sequence[str]
Expand Down
14 changes: 5 additions & 9 deletions django-stubs/db/migrations/operations/special.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Mapping, Sequence
from typing import Any, Literal, Optional, Protocol
from typing import Any, Literal, Protocol

from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
Expand All @@ -16,18 +16,14 @@ class SeparateDatabaseAndState(Operation):

class RunSQL(Operation):
noop: Literal[""]
sql: str | _ListOrTuple[str | tuple[str, dict[str, Any] | Optional[_ListOrTuple[str]]]] # noqa: UP007
reverse_sql: str | None | _ListOrTuple[
str | tuple[str, dict[str, Any] | Optional[_ListOrTuple[str]]] # noqa: UP007
]
sql: str | _ListOrTuple[str | tuple[str, dict[str, Any] | _ListOrTuple[str] | None]]
reverse_sql: str | None | _ListOrTuple[str | tuple[str, dict[str, Any] | _ListOrTuple[str] | None]]
state_operations: Sequence[Operation]
hints: Mapping[str, Any]
def __init__(
self,
sql: str | _ListOrTuple[str | tuple[str, dict[str, Any] | Optional[_ListOrTuple[str]]]], # noqa: UP007
reverse_sql: (
str | None | _ListOrTuple[str | tuple[str, dict[str, Any] | Optional[_ListOrTuple[str]]]] # noqa: UP007
) = ...,
sql: str | _ListOrTuple[str | tuple[str, dict[str, Any] | _ListOrTuple[str] | None]],
reverse_sql: str | None | _ListOrTuple[str | tuple[str, dict[str, Any] | _ListOrTuple[str] | None]] = ...,
state_operations: Sequence[Operation] = ...,
hints: Mapping[str, Any] | None = ...,
elidable: bool = ...,
Expand Down

0 comments on commit a7cb888

Please sign in to comment.