From c2c3e7ffb4e823d14b9259c71acf1a1b26039b3e Mon Sep 17 00:00:00 2001 From: Justin Gu <97915@qq.com> Date: Tue, 7 Jul 2026 22:23:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(release):=20v1.19.6=20release.yml=20?= =?UTF-8?q?=E5=85=88=E6=9E=84=E5=BB=BA=E5=89=8D=E7=AB=AF=E5=86=8D=20pip=20?= =?UTF-8?q?install=EF=BC=88=E4=BF=AE=E5=A4=8DEXE=E4=B8=A2=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v1.19.5 EXE 只有 11MB,双击报 ModuleNotFoundError: No module named 'pandas'。 根因:release.yml 先 pip install -e '.[web,packaging]' 再 Build frontend, 但 force-include 要求 web-ui/dist 在 pip install 时就存在——install 阶段 dist 不存在导致 editable install 静默降级,PyInstaller 收集不到第三方包。 修复:调换步骤顺序,Build frontend 在 Install Python deps 之前。 ci.yml 上一 commit 已同样修复。 --- .github/workflows/release.yml | 15 ++++++++------- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9c4bf4..17ac675 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,19 +31,20 @@ jobs: cache: "npm" cache-dependency-path: web-ui/package-lock.json - # 安装后端(含 [web,packaging] extras:fastapi/uvicorn + pystray/Pillow) - - name: Install Python deps - run: | - pip install -e ".[web,packaging]" - pip install pyinstaller - - # 构建前端 → web-ui/dist/,spec 把它打到 EXE 内的 web_dist/ + # 构建前端 → web-ui/dist/。必须在 pip install 前:pyproject.toml 的 + # force-include 要求 web-ui/dist 存在,否则 pip install -e . 报错。 - name: Build frontend run: | npm ci npm run build working-directory: web-ui + # 安装后端(含 [web,packaging] extras:fastapi/uvicorn + pystray/Pillow) + - name: Install Python deps + run: | + pip install -e ".[web,packaging]" + pip install pyinstaller + - name: Build EXE run: pyinstaller easy_tdx.spec --noconfirm diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e61867..014a210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 本文件记录 easy-tdx 的版本变更。格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/)。 +## [1.19.6] — 2026-07-07 + +**修复 EXE 丢失所有第三方依赖(pandas/numpy/uvicorn 等)** —— v1.19.5 的 EXE 只有 11MB(正常 44MB),双击报 `ModuleNotFoundError: No module named 'pandas'`。根因:`release.yml` 的步骤顺序是先 `pip install -e ".[web,packaging]"` 再 `Build frontend`,但 `pyproject.toml` 的 `force-include` 要求 `web-ui/dist` 在 `pip install` 时就存在——install 阶段 dist 不存在导致 editable install 静默降级,PyInstaller 收集不到第三方包。修复:调换 `release.yml` 步骤顺序,先 `npm run build` 再 `pip install`。 + +### 修复 + +- **release.yml 步骤顺序**(`.github/workflows/release.yml`)—— `Build frontend` 移到 `Install Python deps` 之前,确保 `pip install -e .` 时 `web-ui/dist` 已存在。 + ## [1.19.5] — 2026-07-07 **修复 PyPI 安装后 `localhost:8000` 返回 404** —— `pip install easy-tdx[web]` 后启动 `easy-tdx serve`,浏览器打开 `localhost:8000` 直接 404。根因:PyPI wheel 不含前端 dist(只有 Python 包),`_resolve_web_dist_dir()` 三级探测全失败返回 None,StaticFiles 不挂载。v1.19.2 的 MIME 修复、v1.19.3 的 SPA fallback 都只对 EXE 打包态生效——PyPI 安装态连 dist 都没有,更谈不上 MIME 或 SPA。 diff --git a/pyproject.toml b/pyproject.toml index 5748a6b..1d4f556 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "easy-tdx" -version = "1.19.5" +version = "1.19.6" description = "通达信 TCP 协议行情数据客户端,支持在线行情、离线数据读取与写入同步" readme = "README.md" requires-python = ">=3.10"