pinokiod 1.2.12 → 1.2.13
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/kernel/shell.js +52 -50
- package/package.json +1 -1
package/kernel/shell.js
CHANGED
|
@@ -475,7 +475,6 @@ class Shell {
|
|
|
475
475
|
|
|
476
476
|
// 1. conda
|
|
477
477
|
|
|
478
|
-
let conda_activation = []
|
|
479
478
|
if (params.conda) {
|
|
480
479
|
|
|
481
480
|
// 1. conda_path/conda_name/conda_python
|
|
@@ -509,58 +508,61 @@ class Shell {
|
|
|
509
508
|
}
|
|
510
509
|
}
|
|
511
510
|
}
|
|
511
|
+
} else {
|
|
512
|
+
conda_name = "base"
|
|
513
|
+
}
|
|
512
514
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
conda_activation = [
|
|
552
|
-
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
553
|
-
`conda create -y -n ${conda_name} ${conda_python}`,
|
|
554
|
-
`conda deactivate`,
|
|
555
|
-
`conda deactivate`,
|
|
556
|
-
`conda deactivate`,
|
|
557
|
-
`conda activate ${conda_name}`,
|
|
558
|
-
]
|
|
559
|
-
}
|
|
515
|
+
console.log("CONDA STEP 1", { conda: params.conda, conda_path, conda_name, conda_python })
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
// 2. conda_activation
|
|
519
|
+
let conda_activation = []
|
|
520
|
+
if (conda_path) {
|
|
521
|
+
let env_path = path.resolve(params.path, conda_path)
|
|
522
|
+
let env_exists = await this.exists(env_path)
|
|
523
|
+
if (env_exists) {
|
|
524
|
+
conda_activation = [
|
|
525
|
+
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
526
|
+
`conda deactivate`,
|
|
527
|
+
`conda deactivate`,
|
|
528
|
+
`conda deactivate`,
|
|
529
|
+
`conda activate ${env_path}`,
|
|
530
|
+
]
|
|
531
|
+
} else {
|
|
532
|
+
conda_activation = [
|
|
533
|
+
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
534
|
+
`conda create -y -p ${env_path} ${conda_python}`,
|
|
535
|
+
`conda deactivate`,
|
|
536
|
+
`conda deactivate`,
|
|
537
|
+
`conda deactivate`,
|
|
538
|
+
`conda activate ${env_path}`,
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
} else if (conda_name) {
|
|
542
|
+
let envs_path = this.kernel.bin.path("miniconda/envs")
|
|
543
|
+
let env_path = path.resolve(envs_path, conda_name)
|
|
544
|
+
let env_exists = await this.exists(env_path)
|
|
545
|
+
if (env_exists) {
|
|
546
|
+
conda_activation = [
|
|
547
|
+
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
548
|
+
`conda deactivate`,
|
|
549
|
+
`conda deactivate`,
|
|
550
|
+
`conda deactivate`,
|
|
551
|
+
`conda activate ${conda_name}`,
|
|
552
|
+
]
|
|
560
553
|
} else {
|
|
561
|
-
|
|
562
|
-
|
|
554
|
+
conda_activation = [
|
|
555
|
+
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
556
|
+
`conda create -y -n ${conda_name} ${conda_python}`,
|
|
557
|
+
`conda deactivate`,
|
|
558
|
+
`conda deactivate`,
|
|
559
|
+
`conda deactivate`,
|
|
560
|
+
`conda activate ${conda_name}`,
|
|
561
|
+
]
|
|
563
562
|
}
|
|
563
|
+
} else {
|
|
564
|
+
// no conda name or conda path => means don't activate any env
|
|
565
|
+
conda_activation = []
|
|
564
566
|
}
|
|
565
567
|
|
|
566
568
|
console.log("CONDA STEP 2", { conda_activation })
|