icoa-cli 2.19.79 → 2.19.80
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/dist/commands/exam.js +10 -5
- package/package.json +1 -1
package/dist/commands/exam.js
CHANGED
|
@@ -1925,7 +1925,7 @@ export function registerExamCommand(program) {
|
|
|
1925
1925
|
console.log(chalk.white(' Installing Python packages for practical questions.'));
|
|
1926
1926
|
console.log(chalk.gray(' Expected: 1-2 minutes · ~150MB disk'));
|
|
1927
1927
|
console.log();
|
|
1928
|
-
// Step 1: Check Python 3.12
|
|
1928
|
+
// Step 1: Check Python 3.10+ (all packages support 3.10, 3.12 recommended)
|
|
1929
1929
|
const printPythonInstallGuide = (reason, currentVersion) => {
|
|
1930
1930
|
const platform = process.platform;
|
|
1931
1931
|
console.log();
|
|
@@ -1933,10 +1933,10 @@ export function registerExamCommand(program) {
|
|
|
1933
1933
|
printError('Python 3 not found.');
|
|
1934
1934
|
}
|
|
1935
1935
|
else {
|
|
1936
|
-
printError(`Python ${currentVersion} found, but 3.
|
|
1936
|
+
printError(`Python ${currentVersion} found, but 3.10+ required for the exam.`);
|
|
1937
1937
|
}
|
|
1938
1938
|
console.log();
|
|
1939
|
-
console.log(chalk.bold.white(' How to install Python 3.12:'));
|
|
1939
|
+
console.log(chalk.bold.white(' How to install Python 3.10+ (3.12 recommended):'));
|
|
1940
1940
|
console.log();
|
|
1941
1941
|
if (platform === 'darwin') {
|
|
1942
1942
|
console.log(chalk.yellow(' macOS (Homebrew, recommended):'));
|
|
@@ -1978,11 +1978,16 @@ export function registerExamCommand(program) {
|
|
|
1978
1978
|
const raw = execSync(`${pythonBin} --version`, { encoding: 'utf-8', timeout: 5000 }).trim();
|
|
1979
1979
|
pythonVersion = raw.replace('Python ', '');
|
|
1980
1980
|
const parts = pythonVersion.split('.').map(Number);
|
|
1981
|
-
if (parts[0] < 3 || (parts[0] === 3 && parts[1] <
|
|
1981
|
+
if (parts[0] < 3 || (parts[0] === 3 && parts[1] < 10)) {
|
|
1982
1982
|
printPythonInstallGuide('too_old', pythonVersion);
|
|
1983
1983
|
return;
|
|
1984
1984
|
}
|
|
1985
|
-
|
|
1985
|
+
if (parts[0] === 3 && parts[1] < 12) {
|
|
1986
|
+
console.log(chalk.green(` ✓ Python ${pythonVersion}`) + chalk.gray(' (works, but 3.12 recommended)'));
|
|
1987
|
+
}
|
|
1988
|
+
else {
|
|
1989
|
+
console.log(chalk.green(` ✓ Python ${pythonVersion}`));
|
|
1990
|
+
}
|
|
1986
1991
|
}
|
|
1987
1992
|
catch {
|
|
1988
1993
|
printPythonInstallGuide('missing');
|