Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

chore(tooling): uv 版本只设下限

Peach local maintenance58e14f11221f
diff --git a/docs/REUSE.md b/docs/REUSE.md
index 9bf1b6e35..95dbdb6d5 100644
--- a/docs/REUSE.md
+++ b/docs/REUSE.md
@@ -52,7 +52,7 @@ JAV 默认封面(官方封面/预览图)与默认大小(大图/小图
## 复用决策门槛
-- Python 安装与构建复用 [uv 0.12.13](https://github.com/astral-sh/uv/releases/tag/0.12.13) 和官方 setup-uv 10.0.1,Astral 持续维护,许可证分别为 MIT/Apache-2.0 与 MIT。
+- Python 安装与构建复用 [uv](https://github.com/astral-sh/uv)(`pyproject.toml` 只设下限 `>=0.12.13`,工具版本不进依赖图)和官方 setup-uv 10.0.1,Astral 持续维护,许可证分别为 MIT/Apache-2.0 与 MIT。
使用 uv 项目接口、`uv.lock` 和 `uv sync --locked`;Dependabot 使用官方 `uv` 生态维护锁文件。
开发与构建在隔离工作树创建环境,生产 venv 不参与精确同步。直接依赖精确固定,传递依赖由锁文件复现;动态项目版本无需修改锁文件。
测试数据库复用当前树与 Git 历史中的 `tests/support/ledger.py`,迁移生成模板后复制独立临时库;真实迁移测试仍执行迁移。重试测试复用已有 sleeper 注入点。
diff --git a/pyproject.toml b/pyproject.toml
index 7daa8b8be..b5443a281 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -70,7 +70,10 @@ naming = ["opencc==1.4.2"]
package-dir = {"" = "src"}
[tool.uv]
-required-version = "==0.12.13"
+# 只设下限:uv 是工具不是依赖,它的版本不进依赖图(scripts/test_runner.py 的
+# dependency_inputs 也不算它)。Homebrew、winget 与官方脚本都只装最新版,写死等号
+# 会让每台新机器上的 uv 连 `--no-project` 的钩子都拒绝运行;CI 想复现就在 setup-uv 里给 version。
+required-version = ">=0.12.13"
cache-keys = [{file = "pyproject.toml"}, {file = "setup.py"}, {file = "src/peach/__init__.py"}, {file = "README.md"}]
[tool.setuptools.dynamic]
diff --git a/tests/test_dependency_policy.py b/tests/test_dependency_policy.py
index 645148663..70246d700 100644
--- a/tests/test_dependency_policy.py
+++ b/tests/test_dependency_policy.py
@@ -211,8 +211,9 @@ class DependencyPolicyTests(unittest.TestCase):
self.assertIn("adopt_dependency_bump.py", failure)
def test_uv_installation_preserves_interpreter_and_wheel_contracts(self):
+ # 下限而不是等号:工具版本不进依赖图,等号只会让装了最新 uv 的机器全部被拒。
self.assertRegex(self.pyproject["tool"]["uv"]["required-version"],
- r"^==\d+\.\d+\.\d+$")
+ r"^>=\d+\.\d+\.\d+$")
module = self.pyproject['tool']['setuptools']['dynamic']['version']['attr'].rsplit('.', 1)[0]
version_file = f"src/{module.replace('.', '/')}/__init__.py"
keys = {entry.get('file') for entry in self.pyproject['tool']['uv']['cache-keys']}