refactor: replace isort, black and flake8 with ruff (#1346)
Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run

This commit is contained in:
Juro Oravec 2025-09-10 14:06:53 +02:00 committed by GitHub
parent 5279fd372a
commit f100cc1836
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
128 changed files with 3076 additions and 2599 deletions

View file

@ -27,7 +27,7 @@ else:
class ViewFn(Protocol):
def __call__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> Any: ... # noqa: E704
def __call__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> Any: ...
def _get_component_route_name(component: Union[Type["Component"], "Component"]) -> str:
@ -143,7 +143,7 @@ class ComponentView(ExtensionComponentConfig, View):
```
"""
component_cls = cast(Type["Component"], None)
component_cls = cast("Type[Component]", None)
"""
The parent component class.
@ -220,28 +220,28 @@ class ComponentView(ExtensionComponentConfig, View):
# `return self.component_cls.render_to_response(request, *args, **kwargs)` or similar
# or raise NotImplementedError.
def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return getattr(self.component_cls(), "get")(request, *args, **kwargs)
return self.component_cls().get(request, *args, **kwargs) # type: ignore[attr-defined]
def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return getattr(self.component_cls(), "post")(request, *args, **kwargs)
return self.component_cls().post(request, *args, **kwargs) # type: ignore[attr-defined]
def put(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return getattr(self.component_cls(), "put")(request, *args, **kwargs)
return self.component_cls().put(request, *args, **kwargs) # type: ignore[attr-defined]
def patch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return getattr(self.component_cls(), "patch")(request, *args, **kwargs)
return self.component_cls().patch(request, *args, **kwargs) # type: ignore[attr-defined]
def delete(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return getattr(self.component_cls(), "delete")(request, *args, **kwargs)
return self.component_cls().delete(request, *args, **kwargs) # type: ignore[attr-defined]
def head(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return getattr(self.component_cls(), "head")(request, *args, **kwargs)
return self.component_cls().head(request, *args, **kwargs) # type: ignore[attr-defined]
def options(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return getattr(self.component_cls(), "options")(request, *args, **kwargs)
return self.component_cls().options(request, *args, **kwargs) # type: ignore[attr-defined]
def trace(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return getattr(self.component_cls(), "trace")(request, *args, **kwargs)
return self.component_cls().trace(request, *args, **kwargs) # type: ignore[attr-defined]
class ViewExtension(ComponentExtension):