mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-09 18:59:50 +08:00
- 上游请求启用 HTTP/2 (HPACK 头部压缩 + 多路复用),添加 h2 依赖 - 上游请求体超过阈值时自动 gzip 压缩,使用紧凑 JSON 序列化 - 添加 brotli 依赖,Accept-Encoding 支持 gzip/deflate/br - 隧道帧压缩: Rust 端响应帧和 Python 端请求/响应帧均支持 gzip - Rust 端压缩/解压逻辑统一提取到 protocol.rs - Rust 端请求头构建改用 .headers() 替换 reqwest 默认值 - 新增 ENABLE_HTTP2、ENABLE_REQUEST_COMPRESSION 等环境变量配置
138 lines
3.8 KiB
TOML
138 lines
3.8 KiB
TOML
[build-system]
|
|
requires = ["hatchling", "hatch-vcs"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "aether"
|
|
dynamic = ["version"]
|
|
description = "Proxy server enabling Claude Code to work with OpenAI-compatible API providers"
|
|
readme = "README.md"
|
|
authors = [
|
|
{name = "Aether", email = "[email protected]"}
|
|
]
|
|
classifiers = [
|
|
"Development Status :: 4 - Beta",
|
|
"Intended Audience :: Developers",
|
|
"License :: Other/Proprietary License",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Programming Language :: Python :: 3.14",
|
|
]
|
|
requires-python = ">=3.12"
|
|
dependencies = [
|
|
"fastapi[standard]>=0.128.0",
|
|
"uvicorn>=0.40.0",
|
|
"gunicorn>=24.1.1",
|
|
"pydantic>=2.12.5",
|
|
"python-dotenv>=1.2.1",
|
|
"openai>=2.16.0",
|
|
"httpx[socks,http2]>=0.28.1",
|
|
"brotli>=1.1.0",
|
|
"sqlalchemy>=2.0.46",
|
|
"alembic>=1.18.3",
|
|
"bcrypt>=5.0.0",
|
|
"pyjwt>=2.10.1",
|
|
"certifi>=2026.1.4",
|
|
"cryptography>=46.0.4",
|
|
"psycopg2-binary>=2.9.11",
|
|
"asyncpg>=0.31.0",
|
|
"aiosqlite>=0.22.1",
|
|
"loguru>=0.7.3",
|
|
"tiktoken>=0.12.0",
|
|
"regex>=2026.1.15", # 支持超时的正则库,用于 ReDoS 防护
|
|
"aiofiles>=25.1.0",
|
|
"aiohttp>=3.13.3",
|
|
"aiosmtplib>=5.1.0",
|
|
"redis>=7.1.0",
|
|
"prometheus-client>=0.24.1",
|
|
"apscheduler>=3.11.2",
|
|
"ldap3>=2.9.1",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=7.0.0",
|
|
"pytest-asyncio>=0.21.0",
|
|
"httpx>=0.25.0",
|
|
]
|
|
tls = [
|
|
"tls-client>=1.0.1", # 可选:用于 Claude OAuth token 请求的 TLS 指纹伪装
|
|
"curl_cffi>=0.7.0", # 可选:用于上游请求的真实 TLS 指纹伪装 (Chrome/Firefox)
|
|
]
|
|
|
|
[project.urls]
|
|
Homepage = "https://github.com/fawney19/Aether"
|
|
Repository = "https://github.com/fawney19/Aether.git"
|
|
Issues = "https://github.com/fawney19/Aether/issues"
|
|
|
|
[project.scripts]
|
|
aether = "src.main:main"
|
|
|
|
[tool.uv]
|
|
dev-dependencies = [
|
|
"pytest>=7.0.0",
|
|
"pytest-asyncio>=0.21.0",
|
|
"pytest-cov>=4.0.0",
|
|
"pytest-mock>=3.10.0",
|
|
"factory-boy>=3.2.0",
|
|
"faker>=18.0.0",
|
|
"black>=23.0.0",
|
|
"isort>=5.12.0",
|
|
"mypy>=1.0.0",
|
|
"pyinstaller>=6.15.0",
|
|
"hatch-vcs>=0.5.0",
|
|
]
|
|
|
|
[tool.black]
|
|
line-length = 100
|
|
target-version = ['py313']
|
|
|
|
[tool.isort]
|
|
profile = "black"
|
|
line_length = 100
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src"]
|
|
|
|
[tool.hatch.version]
|
|
source = "vcs"
|
|
|
|
[tool.hatch.build.hooks.vcs]
|
|
version-file = "src/_version.py"
|
|
|
|
[tool.mypy]
|
|
python_version = "3.14"
|
|
warn_return_any = false # 禁用返回 Any 警告(许多第三方库返回 Any)
|
|
warn_unused_configs = true
|
|
disallow_untyped_defs = true
|
|
exclude = "tools/debug"
|
|
# 忽略项目内部模块的 import-untyped 警告
|
|
ignore_missing_imports = true
|
|
# SQLAlchemy mypy 插件
|
|
plugins = ["sqlalchemy.ext.mypy.plugin"]
|
|
|
|
# SQLAlchemy 相关模块放宽类型检查(模型未使用 Mapped 注解)
|
|
[[tool.mypy.overrides]]
|
|
module = ["src.models.*"]
|
|
disable_error_code = ["arg-type", "assignment", "misc", "attr-defined", "return-value"]
|
|
|
|
# 渐进式类型检查:暂时禁用一些复杂的检查,后续逐步启用
|
|
[[tool.mypy.overrides]]
|
|
module = ["src.api.*", "src.services.*", "src.plugins.*", "src.utils.*", "src.clients.*", "src.core.*", "src.config.*"]
|
|
disable_error_code = ["union-attr", "index", "operator", "attr-defined", "no-any-return", "arg-type", "return-value", "assignment", "var-annotated", "misc", "override", "dict-item", "func-returns-value", "no-redef", "call-overload", "type-var", "return", "call-arg"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
python_files = ["test_*.py"]
|
|
python_classes = ["Test*"]
|
|
python_functions = ["test_*"]
|
|
asyncio_mode = "auto"
|
|
addopts = [
|
|
"--cov=src",
|
|
"--cov-report=term-missing",
|
|
"--cov-report=html",
|
|
"-v"
|
|
]
|
|
norecursedirs = ["tools/debug"]
|