pinokiod 3.2.20 → 3.2.22
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/bin/conda.js +9 -1
- package/kernel/shell.js +8 -1
- package/package.json +1 -1
package/kernel/bin/conda.js
CHANGED
|
@@ -114,7 +114,15 @@ create_default_packages:
|
|
|
114
114
|
//}
|
|
115
115
|
|
|
116
116
|
await this.kernel.bin.exec({
|
|
117
|
-
message: cmds
|
|
117
|
+
message: cmds,
|
|
118
|
+
conda: {
|
|
119
|
+
name: "base",
|
|
120
|
+
activate: [
|
|
121
|
+
(this.kernel.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
122
|
+
// 'conda deactivate',
|
|
123
|
+
'conda activate base',
|
|
124
|
+
]
|
|
125
|
+
}
|
|
118
126
|
// [
|
|
119
127
|
// (this.kernel.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
120
128
|
// (this.platform === 'win32' ? `activate base` : `conda activate base`),
|
package/kernel/shell.js
CHANGED
|
@@ -492,6 +492,7 @@ class Shell {
|
|
|
492
492
|
let conda_name
|
|
493
493
|
let conda_python = "python=3.10"
|
|
494
494
|
let conda_args
|
|
495
|
+
let conda_activate
|
|
495
496
|
|
|
496
497
|
if (params.conda) {
|
|
497
498
|
|
|
@@ -518,6 +519,8 @@ class Shell {
|
|
|
518
519
|
throw new Error("when specifying conda as an object, the conda.name or conda.path must exist")
|
|
519
520
|
}
|
|
520
521
|
|
|
522
|
+
if (params.conda.activate) conda_activate = params.conda.activate
|
|
523
|
+
|
|
521
524
|
// conda_python
|
|
522
525
|
if (params.conda.python) {
|
|
523
526
|
conda_python = params.conda.python
|
|
@@ -533,7 +536,9 @@ class Shell {
|
|
|
533
536
|
// 2. conda_activation
|
|
534
537
|
|
|
535
538
|
let conda_activation = []
|
|
536
|
-
if (
|
|
539
|
+
if (conda_activate) {
|
|
540
|
+
conda_activation = conda_activate
|
|
541
|
+
} else if (conda_path) {
|
|
537
542
|
let env_path = path.resolve(params.path, conda_path)
|
|
538
543
|
let env_exists = await this.exists(env_path)
|
|
539
544
|
if (env_exists) {
|
|
@@ -591,6 +596,8 @@ class Shell {
|
|
|
591
596
|
conda_activation = []
|
|
592
597
|
}
|
|
593
598
|
|
|
599
|
+
console.log({ conda_activation })
|
|
600
|
+
|
|
594
601
|
// Visual Studio Build Tools (Exception)
|
|
595
602
|
// only add conda env if conda exists
|
|
596
603
|
// if (conda_activation.length > 0) {
|