refactor: 清理代码日志、重构速率限制器、切换存储方案

- 移除 client.py 和 daily.py 中的调试日志
- 重构 rate_limiter 支持无限超时和更精确的令牌获取
- 变更 stock_basic 存储方案 HDF5 → CSV
- 更新项目规则:强制使用 uv、禁止读取 config/ 目录
- 新增数据同步模块 sync.py 和测试
- .gitignore 添加 !data/ 允许跟踪数据文件
This commit is contained in:
2026-02-01 02:29:54 +08:00
parent 38e78a5326
commit ec08a2578c
13 changed files with 710 additions and 47 deletions

View File

@@ -17,6 +17,41 @@
3. **文档字符串**: 使用 Google 风格的 docstring
4. **测试覆盖**: 关键业务逻辑应有对应的单元测试
## Python 运行规范
**⚠️ 本项目强制使用 uv 作为 Python 包管理器和运行工具。禁止直接使用 `python``pip` 命令。**
### 禁止的命令 ❌
```bash
# 禁止直接使用 python
python -c "..." # 禁止!
python script.py # 禁止!
python -m pytest # 禁止!
python -m pip install # 禁止!
# 禁止直接使用 pip
pip install -e . # 禁止!
pip install package # 禁止!
pip list # 禁止!
```
### 正确的 uv 用法 ✅
```bash
# 运行 Python 代码
uv run python -c "..." # ✅ 正确
uv run python script.py # ✅ 正确
# 安装依赖
uv pip install -e . # ✅ 正确
uv pip install package # ✅ 正确
# 运行测试
uv run pytest # ✅ 正确
uv run pytest tests/test_sync.py # ✅ 正确
```
## 目录结构规范
```