Skip to content

Commit

Permalink
Update django to 5.1.4, drop black
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Dec 5, 2024
1 parent 3dfd79a commit 9e22468
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 22 deletions.
5 changes: 1 addition & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ repos:
hooks:
- id: ruff
args: ["--fix", "--exit-non-zero-on-fix"]
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion django-stubs/core/handlers/exception.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from django.http.response import HttpResponse, HttpResponseBase
from django.urls.resolvers import URLResolver

def convert_exception_to_response(
get_response: Callable[[HttpRequest], HttpResponseBase | Awaitable[HttpResponseBase]]
get_response: Callable[[HttpRequest], HttpResponseBase | Awaitable[HttpResponseBase]],
) -> Callable[[HttpRequest], HttpResponseBase | Awaitable[HttpResponseBase]]: ...
def response_for_exception(request: HttpRequest, exc: Exception) -> HttpResponse: ...
def get_exception_response(
Expand Down
8 changes: 6 additions & 2 deletions django-stubs/db/models/sql/compiler.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class SQLCompiler:
col_count: int | None
def setup_query(self, with_col_aliases: bool = False) -> None: ...
has_extra_select: Any
def pre_sql_setup(self, with_col_aliases: bool = False) -> tuple[
def pre_sql_setup(
self,
with_col_aliases: bool = False,
) -> tuple[
list[tuple[Expression, _AsSqlType, None]],
list[tuple[Expression, tuple[str, _ParamsT, bool]]],
list[_AsSqlType],
Expand All @@ -48,7 +51,8 @@ class SQLCompiler:
self, expressions: list[Expression], having: list[Expression] | tuple
) -> list[Expression]: ...
def get_select(
self, with_col_aliases: bool = False
self,
with_col_aliases: bool = False,
) -> tuple[list[tuple[Expression, _AsSqlType, str | None]], dict[str, Any] | None, dict[str, int]]: ...
def _order_by_pairs(self) -> None: ...
def get_order_by(self) -> list[tuple[Expression, tuple[str, _ParamsT, bool]]]: ...
Expand Down
1 change: 1 addition & 0 deletions django-stubs/utils/html.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ from django.utils.safestring import SafeData, SafeString

VOID_ELEMENTS: frozenset[str]
MAX_URL_LENGTH: int
MAX_STRIP_TAGS_DEPTH: int

def escape(text: Any) -> SafeString: ...
def escapejs(value: Any) -> SafeString: ...
Expand Down
13 changes: 1 addition & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
[tool.black]
target-version = ['py38']
line-length = 120
include = '\.pyi?$'

[tool.codespell]
ignore-words-list = "aadd,acount,nam,asend"

[tool.ruff]
# Adds to default excludes: https://ruff.rs/docs/settings/#exclude
extend-exclude = [
".*/",
"django-source",
"stubgen",
"out",
]
line-length = 120
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
# See Rules in Ruff documentation: https://beta.ruff.rs/docs/rules/
Expand Down
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Dev tools:
black==24.8.0
pre-commit==3.5.0; python_version < '3.9'
pre-commit==4.0.1; python_version >= '3.9'
pre-commit==4.0.1
pytest==8.3.4
pytest-mypy-plugins==3.1.2
pytest-shard==0.1.2
Expand Down

0 comments on commit 9e22468

Please sign in to comment.