@roll-agent/octopus-agent 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/check-python.js +3 -35
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/src/octopus_sponge_skill/_version.py +1 -1
package/README.md
CHANGED
|
@@ -32,8 +32,8 @@ roll run octopus-agent diagnostic_status --json
|
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
该 npm package(npm 包)直接包含 Python 源码;`roll agent install` 不会再从 PyPI 下载 `octopus-sponge-skill`。
|
|
35
|
-
安装机器需要 Python 3.11+。Windows
|
|
36
|
-
|
|
35
|
+
安装机器需要 Python 3.11+。Windows、macOS、Linux 都会检查 `python --version` 和 `python3 --version`,任意一个可用即可。
|
|
36
|
+
安装阶段只执行 Python 环境检查;没有 Python 3.11+ 时会提示手动安装,不会自动安装。
|
|
37
37
|
|
|
38
38
|
### 本地源码注册
|
|
39
39
|
|
package/bin/check-python.js
CHANGED
|
@@ -5,10 +5,7 @@ const { spawnSync } = require("child_process");
|
|
|
5
5
|
const MIN_VERSION = [3, 11, 0];
|
|
6
6
|
|
|
7
7
|
function pythonCandidates() {
|
|
8
|
-
|
|
9
|
-
return [["python"], ["python3"]];
|
|
10
|
-
}
|
|
11
|
-
return [["python3"], ["python"]];
|
|
8
|
+
return [["python"], ["python3"]];
|
|
12
9
|
}
|
|
13
10
|
|
|
14
11
|
function parseVersion(output) {
|
|
@@ -61,24 +58,9 @@ function findPython() {
|
|
|
61
58
|
return { command: null, version: null, checked };
|
|
62
59
|
}
|
|
63
60
|
|
|
64
|
-
function installPython() {
|
|
65
|
-
if (process.platform === "win32") {
|
|
66
|
-
return run(["winget"], ["install", "--id", "Python.Python.3.11", "-e"], {
|
|
67
|
-
stdio: "inherit",
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
if (process.platform === "darwin") {
|
|
71
|
-
return run(["brew"], ["install", "python@3.11"], { stdio: "inherit" });
|
|
72
|
-
}
|
|
73
|
-
return { status: 1 };
|
|
74
|
-
}
|
|
75
|
-
|
|
76
61
|
function printInstallHelp() {
|
|
77
|
-
console.error("未找到 Python 3.11
|
|
78
|
-
console.error("Windows: 安装后确认 `python --version` 可用。");
|
|
79
|
-
console.error("macOS: 安装 Homebrew 后可执行 `brew install python@3.11`。");
|
|
80
|
-
console.error("Linux: 请使用当前发行版的包管理器安装 Python 3.11+。");
|
|
81
|
-
console.error("macOS/Linux: 安装后确认 `python3 --version` 可用。");
|
|
62
|
+
console.error("未找到 Python 3.11+。请手动安装后重试。");
|
|
63
|
+
console.error("Windows/macOS/Linux: 安装后确认 `python --version` 或 `python3 --version` 可用。");
|
|
82
64
|
}
|
|
83
65
|
|
|
84
66
|
function main() {
|
|
@@ -96,20 +78,6 @@ function main() {
|
|
|
96
78
|
console.error(`${commandLabel(item.command)}: ${item.reason}`);
|
|
97
79
|
}
|
|
98
80
|
|
|
99
|
-
console.error("正在尝试自动安装 Python 3.11...");
|
|
100
|
-
const installResult = installPython();
|
|
101
|
-
if (installResult.status === 0) {
|
|
102
|
-
result = findPython();
|
|
103
|
-
if (result.command) {
|
|
104
|
-
console.log(
|
|
105
|
-
`Found Python ${versionLabel(result.version)}: ${commandLabel(
|
|
106
|
-
result.command
|
|
107
|
-
)}`
|
|
108
|
-
);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
81
|
printInstallHelp();
|
|
114
82
|
process.exit(1);
|
|
115
83
|
}
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED