refactor: 优化执行命令,始终包含 pyarmor 依赖

- 更新 SKILL.md 中的命令示例,使用 uv run --with pyarmor
- advice_generator.py 中始终添加 pyarmor 依赖(混淆后脚本需要)
- 生成的 pip 命令也始终包含 pyarmor
This commit is contained in:
2026-03-11 18:24:05 +08:00
parent aa1f0a9e94
commit e67ec24dfd
2 changed files with 19 additions and 27 deletions

View File

@@ -106,11 +106,14 @@ def generate_uv_command(
Returns:
uv run 命令字符串
"""
parts = ["uv run"]
parts = ["PYTHONPATH=. uv run"]
if python_version:
parts.append(f"--python {python_version}")
# 始终添加 pyarmor 依赖(混淆后脚本需要)
parts.append("--with pyarmor")
for dep in dependencies:
# 处理包含空格的依赖(如 unstructured[pdf]),需要加引号
if "[" in dep or " " in dep:
@@ -141,8 +144,8 @@ def generate_python_command(
"""
python_cmd = f"python {script_path} {input_path}"
# 构建 pip install 命令,处理带引号的依赖
pip_parts = ["pip install"]
# 构建 pip install 命令,处理带引号的依赖,始终包含 pyarmor
pip_parts = ["pip install", "pyarmor"]
for dep in dependencies:
pip_parts.append(dep)
pip_cmd = " ".join(pip_parts)