Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(tooling): 发布入口的裸解释器门槛不载入 site

longmeidaoe9adc7ff2310
diff --git a/scripts/agent_worktree.py b/scripts/agent_worktree.py
index 737c4348b..4eb162a83 100644
--- a/scripts/agent_worktree.py
+++ b/scripts/agent_worktree.py
@@ -37,7 +37,7 @@ class WorkspaceError(RuntimeError):
RELEASE_TAG_ENTRY = "scripts/release_tag.py"
#: 仓库自带的 git hook。`create` 与 `integrate` 每次都把 `core.hooksPath` 指到这里:
-#: 哪台机器先走一遗工作流就在哪台装上,不靠人记着去配。
+#: 哪台机器先走一遍工作流就在哪台装上,不靠人记着去配。
HOOKS_PATH = "scripts/githooks"
diff --git a/tests/test_agent_worktree.py b/tests/test_agent_worktree.py
index 4c8829a2b..290238c0b 100644
--- a/tests/test_agent_worktree.py
+++ b/tests/test_agent_worktree.py
@@ -319,7 +319,7 @@ class UnregisteredLeftoverTests(_WorktreeCase):
shutil.rmtree(used)
def test_a_registered_worktree_under_either_root_is_not_swept(self):
- """登记着的工作树归上面那轮按分支状态处理,扇残留这步不许碰。"""
+ """登记着的工作树归上面那轮按分支状态处理,扫残留这步不许碰。"""
for index, root in enumerate(self.roots()):
with self.subTest(root=root.name):
task = f"in-place-{index}"
diff --git a/tests/test_script_policy.py b/tests/test_script_policy.py
index 2d7bf4d89..7a50e35bb 100644
--- a/tests/test_script_policy.py
+++ b/tests/test_script_policy.py
@@ -168,8 +168,10 @@ class ReleaseEntryImportTests(unittest.TestCase):
base / "bin" / "python") if path.is_file()), None)
if interpreter is None:
self.skipTest(f"找不到不带 site-packages 的基底解释器:{base}")
+ # `-S` 不载入 site:基底解释器自己的 site-packages 里也可能装着 filelock,
+ # 载入了就会让重依赖混过这道门槛。`-E` 不认 PYTHONPATH,理由相同。
done = subprocess.run(
- [str(interpreter), "-X", "utf8", "-c",
+ [str(interpreter), "-S", "-E", "-X", "utf8", "-c",
"import scripts.release_tag as entry; print(entry.MASTER_WRITER)"],
cwd=str(ROOT), capture_output=True, text=True, encoding="utf-8",
errors="replace", check=False)