Peach: Local-first video metadata scraper and media manager.
build: Python 下限降到 3.12,CI 同时跑 3.12 与 3.14
longmeidao5d8f9a1e6d20
diff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex 767488657..6470c3b97 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -28,11 +28,10 @@ jobs:fail-fast: falsematrix:os: [windows-latest, macos-latest]- # 只测实际运行的版本。两台机器都按 README 用 3.14 建 venv,Peach 不发 PyPI,- # 没有第三方按 requires-python 安装,所以再测一遍声明下限是空跑:同一个缺陷- # 报四遍,唯一一次 3.12 单独红(run 33368707206)也是预览并发那条计时敏感- # 用例的偶发,不是版本不兼容。要重新加版本,先把使用者是谁写清楚。- python: ["3.14"]+ # 只测两端:3.12 是 `requires-python` 对外声明的下限,陌生用户按它装;+ # 3.14 是维护者两台机器实际运行的版本。中间的 3.13 不测——源码没有用到+ # 3.13 独有的特性,两端都绿时它红的概率不值一个 job。+ python: ["3.12", "3.14"]steps:- uses: actions/checkout@v7- uses: actions/setup-python@v7diff --git a/README.en.md b/README.en.mdindex 4e904b1c3..f84797d96 100644--- a/README.en.md+++ b/README.en.md@@ -66,7 +66,7 @@ The repository stores no media, databases, credentials, logs, `.venv`, build out## Prerequisites-- **Python 3.14**: a hard requirement from `requires-python`. Windows needs the py launcher (`py -3.14`); in a console using the cp936 code page the CLI's Chinese output is garbled, and `PYTHONIOENCODING=utf-8` fixes it.+- **Python 3.12 or newer**: a hard requirement from `requires-python`; the maintainer runs 3.14, and CI tests both 3.12 and 3.14. Windows needs the py launcher (`py -3.14`, substitute the version you installed); in a console using the cp936 code page the CLI's Chinese output is garbled, and `PYTHONIOENCODING=utf-8` fixes it.- **Git**: the editable install runs from a checked-out repository.- **FFmpeg and ffprobe**: not distributed with the repository, which has no downloader for them either. Lookup order: the `PEACH_FFMPEG` / `PEACH_FFPROBE` environment variables → `<data root>/tools/ffmpeg/bin/ffmpeg(.exe)` and `ffprobe(.exe)` → `PATH`. Without them `/healthz` reports `ffmpeg: unavailable`, and frame extraction, contact sheets, probing and covers are all unavailable; browsing and playback of compatible formats still work.- **openssl** (optional, HTTPS only): required to generate the local CA. On Windows it usually comes from Git for Windows (choose the option that puts the Unix tools on `PATH`). Without it `peach init` prints that no local CA was generated and completes normally; once installed, `peach init --force` fills it in.@@ -128,8 +128,8 @@ self-hosted frontend packages are pinned jointly by `package.json`, `package-loc| `maintenance-115` | 115 SHA-1 reconciliation script |GitHub Dependabot checks Python, npm and GitHub Actions weekly; every update PR runs the official-tests on Windows and macOS with Python 3.14. After a frontend dependency update, first install the-locked packages:+tests on Windows and macOS with Python 3.12 and 3.14. After a frontend dependency update, first+install the locked packages:```powershellnpm ci --ignore-scriptsdiff --git a/README.md b/README.mdindex 1d015f287..d6a47e41b 100644--- a/README.md+++ b/README.md@@ -63,7 +63,7 @@ peach-app/## 前置条件-- **Python 3.14**:`requires-python` 的硬要求。Windows 需要 py launcher(`py -3.14`);控制台是 cp936 代码页时 CLI 的中文输出会乱码,设 `PYTHONIOENCODING=utf-8` 即可。+- **Python 3.12 或更高**:`requires-python` 的硬要求,维护者以 3.14 运行,CI 同时测 3.12 与 3.14。Windows 需要 py launcher(`py -3.14`,按本机装的版本换);控制台是 cp936 代码页时 CLI 的中文输出会乱码,设 `PYTHONIOENCODING=utf-8` 即可。- **Git**:以可编辑方式安装要从检出的仓库运行。- **FFmpeg 与 ffprobe**:不随仓库分发,仓库里也没有下载器。查找顺序:环境变量 `PEACH_FFMPEG` / `PEACH_FFPROBE` → `<数据根>/tools/ffmpeg/bin/ffmpeg(.exe)` 与 `ffprobe(.exe)` → `PATH`。缺了 `/healthz` 报 `ffmpeg: unavailable`,抽帧、接触表、探测和封面全部不可用;浏览与播放兼容格式仍可用。- **openssl**(可选,仅 HTTPS):生成本机 CA 的前置。Windows 上通常来自 Git for Windows(安装时选把 Unix 工具放进 `PATH`)。缺了 `peach init` 打印「未生成本机 CA」并正常完成,装好后 `peach init --force` 补上。@@ -119,8 +119,8 @@ Python 运行时与可选工具全部在 `pyproject.toml` 精确固定版本;| `vision` | 头像、封面的人脸取景脚本 || `maintenance-115` | 115 SHA-1 对账脚本 |-GitHub Dependabot 每周检查 Python、npm 和 GitHub Actions;每个更新 PR 都运行 Windows/macOS、-Python 3.14 正式测试。前端依赖更新后,先安装锁定包:+GitHub Dependabot 每周检查 Python、npm 和 GitHub Actions;每个更新 PR 都在 Windows/macOS 上以+Python 3.12 与 3.14 运行正式测试。前端依赖更新后,先安装锁定包:```powershellnpm ci --ignore-scriptsdiff --git a/docs/PRODUCT_BACKLOG.md b/docs/PRODUCT_BACKLOG.mdindex 4d063dab4..3dc5997e6 100644--- a/docs/PRODUCT_BACKLOG.md+++ b/docs/PRODUCT_BACKLOG.md@@ -11,7 +11,7 @@5. **厂牌 Logo 补齐与持续校验**:14 个已确认社交 handle 已有内容缓存、provenance、精确/感知哈希、质量与重复门槛及健康报告;仍有 72 个厂牌没有可信 handle,必须继续从官网/公开来源取证,不能猜账号。6. **口味证据持续刷新**:ledger 已实时记录搜索、播放、高潮、喜欢/理由、不合口味和稍后看;浏览器历史现可用 SQLite 一致性副本增量进入私有源库,并生成不含 URL/标题的 creator/tag candidate 与聚合报告。旧 2026-08-13 原始包已确认不在 Windows 外置盘;仍需在 Mac 开启 iCloud Safari、完成首次导入,并把两端每周刷新装成系统计划任务。AI 结论不得直接改真相字段。-## 尚未实现(18 项)+## 尚未实现(17 项)1. AI Provider 的真实调用、能力协商、Credential Manager 凭据和候选审核 UI。2. 剩余单一创作者风格板复核、无标签内容补标。@@ -27,12 +27,11 @@12. `pip install .`(非 editable)可用:wheel 只含 `src/` 下的包,`migrations/` 与 `web/` 留在仓库根,非可编辑安装下 `migrations.discover()` 抛 `FileNotFoundError`。把这两个目录做成 package data,并让 `PROJECT_ROOT` 的解析在 site-packages 里也成立。13. `/healthz` 的 `db` 判据改为「`schema_migration` 有行」:目前只看文件存在,空账本也报 available。14. 界面国际化:界面目前只有中文,先补英文。-15. Python 下限:评估从 3.14 降到 3.12,并把两个版本都进 CI 矩阵。-16. 制品对下载者可用与更新渠道:Release 工作流已按 tag 产出 Windows 与 macOS 压缩包,但两者都只是托盘/菜单栏入口,服务仍由仓库 `.venv` 承担,下载者仍要先完成源码安装;要做成不依赖检出的独立发行版,并让托盘「检查更新」对下载的制品也成立(目前只对 git 检出成立)。-17. 「第一个小时」教程与故障排查文档:init → 声明来源根 → scan → 打开页面 → 手机信任 CA → 托盘/菜单栏自启动,每一步写清失败表现与对应的排查动作。-18. 项目网站:一页说明是什么、截图、安装入口与文档链接。+15. 制品对下载者可用与更新渠道:Release 工作流已按 tag 产出 Windows 与 macOS 压缩包,但两者都只是托盘/菜单栏入口,服务仍由仓库 `.venv` 承担,下载者仍要先完成源码安装;要做成不依赖检出的独立发行版,并让托盘「检查更新」对下载的制品也成立(目前只对 git 检出成立)。+16. 「第一个小时」教程与故障排查文档:init → 声明来源根 → scan → 打开页面 → 手机信任 CA → 托盘/菜单栏自启动,每一步写清失败表现与对应的排查动作。+17. 项目网站:一页说明是什么、截图、安装入口与文档链接。-合计:**24 项开放需求**,其中 6 项已有骨架,18 项尚未实现。已完成的需求不在这里留痕,去 Git 历史查。+合计:**23 项开放需求**,其中 6 项已有骨架,17 项尚未实现。已完成的需求不在这里留痕,去 Git 历史查。## 待执行的操作(27 项)diff --git a/pyproject.toml b/pyproject.tomlindex 7271a6d57..d19822256 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -10,7 +10,7 @@ readme = "README.md"# SPDX 表达式必须和 `LICENSE` 全文一致,换许可证要先改 ADR-0023 第 4 阶段;# `tests/test_repo_hygiene.py` 钉住 LICENSE 那一侧。license = "AGPL-3.0-or-later"-requires-python = ">=3.14"+requires-python = ">=3.12"# `Private :: Do Not Upload` 不是修饰语:Peach 只自托管、不发 PyPI# (`.github/workflows/test.yml`),PyPI 拒收带这枚 classifier 的包,# 所以误跑 `twine upload` 会在传上去之前就被挡住。@@ -20,6 +20,8 @@ classifiers = ["Operating System :: MacOS","Operating System :: Microsoft :: Windows","Programming Language :: Python :: 3",+ "Programming Language :: Python :: 3.12",+ "Programming Language :: Python :: 3.13","Programming Language :: Python :: 3.14","Topic :: Database :: Front-Ends","Topic :: Multimedia :: Video",diff --git a/tests/test_scripts.py b/tests/test_scripts.pyindex eca66045b..a7409ad8f 100644--- a/tests/test_scripts.py+++ b/tests/test_scripts.py@@ -7,6 +7,7 @@ import jsonimport sqlite3import sysimport tempfile+import tomllibimport unittestfrom contextlib import redirect_stdoutfrom pathlib import Path, PureWindowsPath@@ -265,6 +266,22 @@ class OperationalScriptTests(unittest.TestCase):f"{relative}:{number} 单独出现了裸命令,读者会照抄;必须同时点明正式入口",)+ def test_python_floor_is_declared_once_and_ci_tests_both_ends(self):+ """`requires-python` 是唯一真相;CI 矩阵与两份 README 都从它推出来。++ 下限是陌生用户按 `pip install` 装的那一端,3.14 是维护者本机运行的那一端;+ 两端都在矩阵里,README 的前置条件写的也是同一个下限,三处任一处单改都要红。+ """+ project = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))["project"]+ floor = project["requires-python"].removeprefix(">=")+ self.assertEqual(floor, "3.12")+ for version in (floor, "3.14"):+ self.assertIn(f"Programming Language :: Python :: {version}", project["classifiers"])+ workflow = (ROOT / ".github" / "workflows" / "test.yml").read_text(encoding="utf-8")+ self.assertIn(f'python: ["{floor}", "3.14"]', workflow)+ self.assertIn(f"Python {floor} 或更高", (ROOT / "README.md").read_text(encoding="utf-8"))+ self.assertIn(f"Python {floor} or newer", (ROOT / "README.en.md").read_text(encoding="utf-8"))+def test_functional_test_scopes_are_explicit_and_full_remains_the_default(self):runner = load_script("test_runner")follow = {path.name for path in runner.selected_files("follow")}