- config.yaml database.mysql:host/port/db/user/charset 明文可提交;密码经 password_env 引用 .env 的 MYSQL_PASSWORD(AGENT.md §33 密钥不进 git) - config.py _build_mysql_url:URL 优先级 DATABASE_URL env > database.mysql 段 > sqlite 兜底 - pyproject 引入 pymysql>=1.1 - tests/conftest.py 强制每进程 /tmp SQLite(测试绝不触 MySQL 开发库);test_config 覆盖 mysql 组装/密码可选/sqlite 兜底分支 - scripts/migrate_sqlite_to_mysql.py:sqlite→mysql 一次性迁移工具(keyset 分页 + chunk 多值 INSERT + 攒批 commit + 幂等续传 + 低配 MySQL 节流 --throttle-sec + --verify-only 行数与抽样一致性校验);已用于 data/quant.db 约 1605 万行迁移并经校验一致
48 lines
1.2 KiB
TOML
48 lines
1.2 KiB
TOML
[project]
|
||
name = "qlib-platform-backend"
|
||
version = "0.1.0"
|
||
description = "A股个人量化研究平台后端:Qlib 研究引擎 / Tushare 数据源 / FastAPI"
|
||
readme = "../README.md"
|
||
requires-python = ">=3.12"
|
||
dependencies = [
|
||
"fastapi>=0.115",
|
||
"uvicorn[standard]>=0.32",
|
||
"sqlalchemy>=2.0",
|
||
"alembic>=1.13",
|
||
"pyyaml>=6.0",
|
||
"httpx>=0.28.1",
|
||
# Qlib 研究引擎:PyPI 无 aarch64 wheel(见 docs/ROADMAP.md §2 备注),故从源码 git 安装并固定 commit。
|
||
# 网络下载困难时使用 HTTP 代理(见根目录 AGENT.md §0:192.168.1.160:3128)。
|
||
"pyqlib @ git+https://github.com/microsoft/qlib.git@79633dd",
|
||
"pymysql>=1.1",
|
||
]
|
||
|
||
[project.optional-dependencies]
|
||
# Phase 1 数据同步需要:uv sync --extra datasource-tushare
|
||
datasource-tushare = ["tushare>=1.4"]
|
||
|
||
[dependency-groups]
|
||
dev = [
|
||
"pytest>=8.0",
|
||
"httpx>=0.27",
|
||
"ruff>=0.6",
|
||
]
|
||
|
||
# uv:本项目是应用(backend/app),不作为可分发包构建
|
||
[tool.uv]
|
||
package = false
|
||
|
||
[tool.pytest.ini_options]
|
||
testpaths = ["tests"]
|
||
pythonpath = ["."]
|
||
addopts = "-q"
|
||
|
||
[tool.ruff]
|
||
line-length = 100
|
||
target-version = "py312"
|
||
src = ["app", "tests"]
|
||
|
||
[tool.ruff.lint]
|
||
select = ["E", "F", "I", "UP", "B", "SIM"]
|
||
ignore = ["E501"]
|