From 2067b80958bd622ddb84b3d8a3833b4d12e9be45 Mon Sep 17 00:00:00 2001 From: GitHub Date: Thu, 2 Jul 2026 03:53:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20scipy=201.17=20=E8=A6=81=E6=B1=82=20?= =?UTF-8?q?Python>=3D3.11=EF=BC=8CCI=20=E8=B7=91=203.10=20=E8=A3=85?= =?UTF-8?q?=E4=B8=8D=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit requirements-dev.txt 锁定的 scipy==1.17.0 与 pyproject 声明的 requires-python=>=3.10 冲突(scipy 1.16+ 起要求 Python>=3.11), 导致 CI 矩阵里 3.10 的 job(ubuntu + windows)pip install 失败。 修复: - requirements-dev.txt: scipy 1.17.0 → 1.15.3(支持 >=3.10 的最新 scipy) - pyproject.toml [dev]/[science]: scipy>=1.10 → >=1.10,<1.16 (CI 第一步 pip install -e .[dev] 在 3.10 上也会拉到 1.17,加同上界) 附注:仅影响开发/CI 环境,运行时用户(pip install easy-tdx)不受影响。 本地 761 单测 + ruff + coverage(62%) 全过。requirements-dev.txt 头部加注释说明 3.10 兼容约束,防日后再次踩坑。 --- pyproject.toml | 4 ++-- requirements-dev.txt | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a43717d..47ade58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,8 +14,8 @@ dependencies = ["pandas>=2.0,<3", "tzdata>=2024.1", "click>=8.0,<9"] easy-tdx = "easy_tdx.cli:cli" # cli/__init__.py exposes the click group [project.optional-dependencies] -dev = ["pytest>=8.0", "pytest-asyncio>=0.23", "pytest-cov", "mypy>=1.9", "ruff>=0.4", "scipy>=1.10"] -science = ["scipy>=1.10"] +dev = ["pytest>=8.0", "pytest-asyncio>=0.23", "pytest-cov", "mypy>=1.9", "ruff>=0.4", "scipy>=1.10,<1.16"] +science = ["scipy>=1.10,<1.16"] web = ["fastapi>=0.110,<1", "uvicorn[standard]>=0.29"] [tool.hatch.build.targets.wheel] diff --git a/requirements-dev.txt b/requirements-dev.txt index 4f5c690..4ab8442 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,11 @@ # 开发工具链锁文件 —— 锁定 dev 依赖的具体版本,保证 CI 构建可复现。 # 运行时依赖(pandas/tzdata/click 等)由 pyproject.toml 的下界+上界约束, # 此文件仅锁定 [dev] 工具链(pytest/mypy/ruff/scipy/coverage 等)。 -# 升级任一工具时请同步更新此文件并重新验证 CI。 +# +# 版本兼容约束:pyproject.toml 声明 requires-python = ">=3.10",CI 矩阵跑 +# ["3.10", "3.12", "3.13"]。因此所有锁定版本必须能在 Python 3.10 上安装。 +# 例:scipy>=1.16 要求 Python>=3.11,故本文件锁定 1.15.3(支持 >=3.10 的 +# 最新 scipy)。升级任一工具时请在本地用 Python 3.10 验证后再提交。 # 测试框架 pytest==8.3.5 @@ -14,7 +18,8 @@ mypy==2.1.0 ruff==0.11.11 # 科学计算([dev] 与 [science] 可选依赖) -scipy==1.17.0 +# scipy 1.16+ 要求 Python>=3.11,CI 还跑 3.10,故锁定 1.15.3(3.10 兼容上限)。 +scipy==1.15.3 numpy==2.2.3 # Web 可选依赖测试支持