mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
fix: 修复 mypy 类型检查错误并升级到 Python 3.14
主要变更: - 修复 1483 个 mypy 类型检查错误 - 添加缺失的类型注解 (Any, Callable, Session 等) - 修复隐式 Optional 类型 (param: Type = None -> param: Type | None = None) - 修复 __new__ 单例模式返回类型 - 添加 type: ignore 注释处理第三方库类型问题 - 更新 pyproject.toml 依赖到 Python 3.14 兼容版本 - 更新 mypy/black 配置为 Python 3.14
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
从环境变量或 .env 文件加载配置
|
||||
"""
|
||||
|
||||
from typing import Any
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
@@ -383,7 +384,7 @@ class Config:
|
||||
return self._database_url
|
||||
|
||||
@database_url.setter
|
||||
def database_url(self, value: str):
|
||||
def database_url(self, value: str) -> Any:
|
||||
"""允许在测试中设置数据库 URL"""
|
||||
self._database_url = value
|
||||
|
||||
@@ -452,7 +453,7 @@ class Config:
|
||||
|
||||
return errors
|
||||
|
||||
def __repr__(self):
|
||||
def __repr__(self) -> None:
|
||||
"""配置信息字符串表示"""
|
||||
return f"""
|
||||
Configuration:
|
||||
|
||||
Reference in New Issue
Block a user