@chikhamx/voidx 2.0.0 → 2.0.1
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/bin/voidx.js +34 -4
- package/package.json +1 -1
package/bin/voidx.js
CHANGED
|
@@ -56,7 +56,7 @@ function selectPython(env) {
|
|
|
56
56
|
return candidate;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
// 2. Bundled Python (
|
|
59
|
+
// 2. Bundled Python (preferred)
|
|
60
60
|
const bundledBin = resolveBundledPythonBin(env);
|
|
61
61
|
if (bundledBin && fs.existsSync(bundledBin)) {
|
|
62
62
|
const candidate = { command: bundledBin, args: [], label: "bundled" };
|
|
@@ -66,10 +66,40 @@ function selectPython(env) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
//
|
|
69
|
+
// 3. System Python fallback (for upgrades from v1.x where bundled Python was not used)
|
|
70
|
+
const candidates = [
|
|
71
|
+
{ command: "python3", args: [], label: "python3" },
|
|
72
|
+
{ command: "python", args: [], label: "python" },
|
|
73
|
+
{ command: "python3.13", args: [], label: "python3.13" },
|
|
74
|
+
{ command: "python3.12", args: [], label: "python3.12" },
|
|
75
|
+
{ command: "python3.11", args: [], label: "python3.11" },
|
|
76
|
+
];
|
|
77
|
+
if (process.platform === "win32") {
|
|
78
|
+
candidates.push({ command: "py", args: ["-3"], label: "py -3" });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const oldVersions = [];
|
|
82
|
+
for (const candidate of candidates) {
|
|
83
|
+
const probe = probePython(candidate);
|
|
84
|
+
if (!probe.ok) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (isCompatible(probe.version)) {
|
|
88
|
+
return candidate;
|
|
89
|
+
}
|
|
90
|
+
oldVersions.push(`${probe.versionText} at ${candidate.label}`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (oldVersions.length > 0) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`voidx requires Python 3.11+. Found ${oldVersions.join(", ")}.\n` +
|
|
96
|
+
"Install Python 3.11+ or reinstall the npm package to get the bundled runtime:\n" +
|
|
97
|
+
" npm install -g @chikhamx/voidx"
|
|
98
|
+
);
|
|
99
|
+
}
|
|
70
100
|
throw new Error(
|
|
71
|
-
"voidx
|
|
72
|
-
"
|
|
101
|
+
"voidx requires Python 3.11+. No Python found.\n" +
|
|
102
|
+
"Install Python 3.11+ or reinstall the npm package to get the bundled runtime:\n" +
|
|
73
103
|
" npm install -g @chikhamx/voidx"
|
|
74
104
|
);
|
|
75
105
|
}
|