- 新增 pyproject.toml 替代 requirements.txt,合并 pytest.ini 配置 - 添加 greenlet、httpx[socks] 依赖修复运行时错误 - 添加 basedpyright + ruff 开发工具及配置 - 更新 Dockerfile 使用 uv 安装依赖 - 更新 CLAUDE.md 所有后端命令为 uv 前缀 - 删除 requirements.txt 和 pytest.ini Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
73 lines
1.6 KiB
TOML
73 lines
1.6 KiB
TOML
[project]
|
|
name = "kol-insight-backend"
|
|
version = "0.1.0"
|
|
description = "KOL Insight - KOL 数据查询与分析工具后端"
|
|
requires-python = ">=3.11"
|
|
dependencies = [
|
|
# Web Framework
|
|
"fastapi>=0.104.0",
|
|
"uvicorn[standard]>=0.24.0",
|
|
# Database
|
|
"sqlalchemy>=2.0.0",
|
|
"asyncpg>=0.29.0",
|
|
"alembic>=1.12.0",
|
|
"greenlet>=3.0.0",
|
|
# HTTP Client
|
|
"httpx[socks]>=0.25.0",
|
|
# Data Validation
|
|
"pydantic>=2.0.0",
|
|
"pydantic-settings>=2.0.0",
|
|
# Excel Export
|
|
"openpyxl>=3.1.0",
|
|
# Environment
|
|
"python-dotenv>=1.0.0",
|
|
]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pytest>=7.4.0",
|
|
"pytest-asyncio>=0.21.0",
|
|
"pytest-cov>=4.1.0",
|
|
"basedpyright>=1.20.0",
|
|
"ruff>=0.8.0",
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
asyncio_mode = "auto"
|
|
asyncio_default_fixture_loop_scope = "function"
|
|
addopts = "-v --cov=app --cov-report=html --cov-report=term-missing"
|
|
|
|
[tool.basedpyright]
|
|
typeCheckingMode = "basic"
|
|
pythonVersion = "3.11"
|
|
include = ["app"]
|
|
exclude = [".venv", "**/__pycache__", "alembic", "tests"]
|
|
extraPaths = ["app"]
|
|
reportMissingTypeStubs = false
|
|
reportUnknownMemberType = false
|
|
reportUnknownArgumentType = false
|
|
reportGeneralTypeIssues = false
|
|
reportOptionalMemberAccess = "warning"
|
|
|
|
[tool.ruff]
|
|
line-length = 150
|
|
target-version = "py311"
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
"E", # pycodestyle 错误
|
|
"F", # Pyflakes 错误(未定义变量、未使用导入等)
|
|
"B", # bugbear 安全警告
|
|
"I", # import 排序
|
|
]
|
|
ignore = ["E501"]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"!app/**" = ["E", "F", "B", "I"]
|
|
|
|
[tool.ruff.format]
|
|
quote-style = "double"
|
|
indent-style = "space"
|
|
line-ending = "auto"
|