Skip to content

Commit 80503ff

Browse files
authored
chore: update pre-commit hooks (#4033)
1 parent 938f940 commit 80503ff

Some content is hidden

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

49 files changed

+118
-71
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.12.10
3+
rev: v0.14.1
44
hooks:
55
- id: ruff-format
66
exclude: ^tests/\w+/snapshots/
@@ -31,7 +31,7 @@ repos:
3131
args: ["--branch", "main"]
3232

3333
- repo: https://github.com/adamchainz/blacken-docs
34-
rev: 1.19.1
34+
rev: 1.20.0
3535
hooks:
3636
- id: blacken-docs
3737
args: [--skip-errors]

poetry.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pyinstrument = ["pyinstrument>=4.0.0"]
7474

7575
[dependency-groups]
7676
dev = [
77-
"ruff (>=0.12.3,<0.13.0)",
77+
"ruff (>=0.14.1,<0.15.0)",
7878
"asgiref (>=3.2,<4.0)",
7979
"email-validator (>=1.1.3,<3.0.0)",
8080
"freezegun (>=1.2.1,<2.0.0)",
@@ -371,7 +371,18 @@ ignore = [
371371

372372
[tool.ruff.lint.isort]
373373
known-first-party = ["strawberry"]
374-
known-third-party = ["django", "graphql"]
374+
known-third-party = [
375+
"django",
376+
"graphql",
377+
"fastapi",
378+
"pydantic",
379+
"litestar",
380+
"aiohttp",
381+
"channels",
382+
"sanic",
383+
"chalice",
384+
"quart",
385+
]
375386
extra-standard-library = ["typing_extensions"]
376387

377388
[tool.ruff.format]

strawberry/aiohttp/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
TypeGuard,
1010
)
1111

12+
from aiohttp import ClientConnectionResetError, http, web
1213
from lia import AiohttpHTTPRequestAdapter, HTTPException
1314

14-
from aiohttp import ClientConnectionResetError, http, web
1515
from strawberry.http.async_base_view import (
1616
AsyncBaseHTTPView,
1717
AsyncWebSocketAdapter,

strawberry/chalice/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import warnings
44
from typing import TYPE_CHECKING
55

6+
from chalice.app import Request, Response
67
from lia import ChaliceHTTPRequestAdapter, HTTPException
78

8-
from chalice.app import Request, Response
99
from strawberry.http.sync_base_view import SyncBaseHTTPView
1010
from strawberry.http.temporal_response import TemporalResponse
1111
from strawberry.http.typevars import Context, RootValue

strawberry/channels/handlers/http_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
from typing_extensions import assert_never
1010
from urllib.parse import parse_qs
1111

12+
from channels.db import database_sync_to_async
13+
from channels.generic.http import AsyncHttpConsumer
1214
from django.conf import settings
1315
from django.core.files import uploadhandler
1416
from django.http.multipartparser import MultiPartParser
1517
from lia import AsyncHTTPRequestAdapter, FormData, HTTPException, SyncHTTPRequestAdapter
1618

17-
from channels.db import database_sync_to_async
18-
from channels.generic.http import AsyncHttpConsumer
1919
from strawberry.http.async_base_view import AsyncBaseHTTPView
2020
from strawberry.http.sync_base_view import SyncBaseHTTPView
2121
from strawberry.http.temporal_response import TemporalResponse

strawberry/channels/router.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
from typing import TYPE_CHECKING
1111

12-
from django.urls import re_path
13-
1412
from channels.routing import ProtocolTypeRouter, URLRouter
13+
from django.urls import re_path
1514

1615
from .handlers.http_handler import GraphQLHTTPConsumer
1716
from .handlers.ws_handler import GraphQLWSConsumer

strawberry/channels/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
Any,
77
)
88

9+
from channels.testing.websocket import WebsocketCommunicator
910
from graphql import GraphQLError, GraphQLFormattedError
1011

11-
from channels.testing.websocket import WebsocketCommunicator
1212
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
1313
from strawberry.subscriptions.protocols.graphql_transport_ws import (
1414
types as transport_ws_types,

strawberry/dataloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __len__(self) -> int:
5050
return len(self.tasks)
5151

5252

53-
class AbstractCache(Generic[K, T], ABC):
53+
class AbstractCache(ABC, Generic[K, T]):
5454
@abstractmethod
5555
def get(self, key: K) -> Future[T] | None:
5656
pass

strawberry/fastapi/router.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
cast,
1111
)
1212

13+
from fastapi import APIRouter, Depends, params
14+
from fastapi.datastructures import Default
15+
from fastapi.routing import APIRoute
16+
from fastapi.utils import generate_unique_id
1317
from lia import HTTPException, StarletteRequestAdapter
1418
from starlette import status
1519
from starlette.background import BackgroundTasks # noqa: TC002
@@ -23,10 +27,6 @@
2327
)
2428
from starlette.websockets import WebSocket
2529

26-
from fastapi import APIRouter, Depends, params
27-
from fastapi.datastructures import Default
28-
from fastapi.routing import APIRoute
29-
from fastapi.utils import generate_unique_id
3030
from strawberry.asgi import ASGIWebSocketAdapter
3131
from strawberry.exceptions import InvalidCustomContext
3232
from strawberry.fastapi.context import BaseContext, CustomContext

0 commit comments

Comments
 (0)