style(project): remove from __future__ import annotations

This commit is contained in:
MingxuanGame
2025-10-03 17:15:41 +00:00
parent 046f894407
commit dfd656f2fb
137 changed files with 94 additions and 362 deletions

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from collections.abc import Awaitable, Callable
from typing import TYPE_CHECKING, NamedTuple

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from enum import IntEnum
from typing import Annotated, Any, Literal

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from typing import Any
from pydantic import BaseModel

View File

@@ -2,8 +2,6 @@
扩展的 OAuth 响应模型,支持二次验证
"""
from __future__ import annotations
from pydantic import BaseModel

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from dataclasses import dataclass
from datetime import UTC, datetime

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
import hashlib
import json
from typing import Any, Literal, NotRequired, TypedDict

View File

@@ -1,5 +1,4 @@
# ruff: noqa: ARG002
from __future__ import annotations
from abc import abstractmethod
from enum import Enum
@@ -161,7 +160,7 @@ class ChannelMessageTeam(ChannelMessageBase):
cls,
message: "ChatMessage",
user: "User",
) -> ChannelMessageTeam:
) -> Self:
from app.database import ChannelType
return super().init(message, user, [], ChannelType.TEAM)

View File

@@ -1,4 +1,4 @@
# OAuth 相关模型 # noqa: I002
# OAuth 相关模型
from typing import Annotated, Any, cast
from typing_extensions import Doc

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from app.models.mods import APIMod

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from enum import Enum
from pydantic import BaseModel

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from enum import Enum
from typing import TYPE_CHECKING, Literal, TypedDict, cast

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from pydantic import BaseModel

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
import json
from app.log import log

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from enum import Enum
from typing import TypedDict

View File

@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import NotRequired, TypedDict

View File

@@ -2,8 +2,6 @@
用户页面编辑相关的API模型
"""
from __future__ import annotations
from pydantic import BaseModel, Field, field_validator

View File

@@ -1,7 +1,5 @@
"""V1 API 用户相关模型"""
from __future__ import annotations
from pydantic import BaseModel, Field