mirror of
https://github.com/shy3130/tick-stock-panel.git
synced 2026-11-02 10:26:13 +00:00
合并 0.3.6 分支全部内容 (36 提交, 详细历史见 0.3.6 分支): ■ 数据与插件 - TdxQuant 数据源: 通达信量化接入 (实时/五档/日K/复权/分钟), tdxaidata 收进默认依赖 - 扩展表两级拉取配方: 概念/行业出厂即带完整可拉配置, 可作自定义接入参考示例 - 能力门禁日志带生效源; 标的池解析只走 instruments 维表 ■ 页面扩展化 - 11 个官方页面全量迁移为单文件扩展 (custom/*/extension.tsx), 删目录即卸载 - 运行时页面包系统: 打包产物上传即挂载, 免重建宿主 - 新装用户扩展页默认隐藏, 老用户升级菜单无感 ■ AI - Responses 协议接入; 会话历史与长任务跨设备同步 (服务端注册表) - 助手头部快捷入口 + 悬浮球拖拽 zoom 坐标系修复 + 系统设置开关 ■ 界面 - 设置「关于」子菜单: 版权/更新/打赏 + 开源许可弹窗与合规声明双保险 - 侧栏两态收起、数据/AI 助手快捷行 (同步呼吸光晕)、核心/扩展 ext 标记 - 界面缩放默认 90%; 菜单设置徽标 Swiss 化; 策略池「叠加」分组 - 情绪评分口径可配置; 财务画像 5 张子表手动拉取 ■ 文档与其他 - README 重构「核心+扩展」主线 + 架构图重画; 开放端点数核实为 65 - 版本号 bump 0.3.6; tdx 物化库测试夹具补 macOS dylib
40 lines
1.9 KiB
Python
40 lines
1.9 KiB
Python
"""tsp.spec 打包不变量 — 运行时动态发现的模块必须随冻结产物发布 (issue #459)。
|
|
|
|
app/extensions/loader.py 用 importlib.import_module + pkgutil.iter_modules 在
|
|
运行时发现 app/custom/*, 两条链路对 PyInstaller 静态分析都不可见; tsp.spec
|
|
未声明时冻结产物里扩展静默消失(桌面版 AI 对话助手 405, 且无任何日志)。
|
|
锁定双声明契约:
|
|
- hiddenimports(collect_submodules) 进 PYZ —— 保 import_module 可导入;
|
|
- datas 落盘到 app/custom —— frozen 下 app.__path__ 解析到 _internal/app,
|
|
保 pkgutil.iter_modules 可枚举(与 fuyao 插件同一处理方式)。
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
SPEC_TEXT = (REPO_ROOT / "packaging" / "tsp.spec").read_text(encoding="utf-8")
|
|
# 只断言代码行, 避免被注释里的字样误判为已声明
|
|
SPEC_CODE = "\n".join(
|
|
line for line in SPEC_TEXT.splitlines() if not line.lstrip().startswith("#")
|
|
)
|
|
|
|
|
|
def test_spec_declares_custom_extensions():
|
|
"""app/custom/* 双声明: PYZ 可导入 + 磁盘可枚举, 缺一冻结后扩展静默消失。"""
|
|
assert 'collect_submodules("app.custom")' in SPEC_CODE
|
|
assert '"app/custom"' in SPEC_CODE
|
|
|
|
|
|
def test_spec_declares_builtin_plugin_fuyao():
|
|
"""fuyao 插件双声明不被回归 (同类动态发现问题, 见 spec 内注释)。"""
|
|
assert "app.plugins.fuyao.provider" in SPEC_CODE
|
|
assert "app/plugins/fuyao" in SPEC_CODE
|
|
|
|
|
|
def test_spec_declares_builtin_plugin_tdx():
|
|
"""tdx 插件双声明不被回归 (与 fuyao 同一处理方式; probe 子进程入口也要可导入)。"""
|
|
assert "app.plugins.tdxquant.provider" in SPEC_CODE
|
|
assert "app.plugins.tdxquant.client" in SPEC_CODE
|
|
assert "app.plugins.tdxquant.probe" in SPEC_CODE
|
|
assert '"plugins" / "tdxquant" / "plugin.yaml"' in SPEC_CODE # 源路径必须指向现存目录
|