@platforma-sdk/workflow-tengo 2.14.0 → 2.15.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.
Files changed (80) hide show
  1. package/README.md +17 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +3 -1
  4. package/dist/index.mjs +3 -1
  5. package/dist/tengo/lib/assets.lib.tengo +28 -28
  6. package/dist/tengo/lib/assets.swinfo.lib.tengo +24 -24
  7. package/dist/tengo/lib/constants.lib.tengo +6 -3
  8. package/dist/tengo/lib/exec.R.internal.lib.tengo +2 -2
  9. package/dist/tengo/lib/exec.R.lib.tengo +41 -41
  10. package/dist/tengo/lib/exec.descriptor.lib.tengo +3 -3
  11. package/dist/tengo/lib/exec.internal.lib.tengo +41 -41
  12. package/dist/tengo/lib/exec.lib.tengo +289 -289
  13. package/dist/tengo/lib/exec.limits.lib.tengo +49 -49
  14. package/dist/tengo/lib/exec.monetization.lib.tengo +1 -1
  15. package/dist/tengo/lib/exec.monetization_internal.lib.tengo +38 -38
  16. package/dist/tengo/lib/exec.package.lib.tengo +53 -53
  17. package/dist/tengo/lib/exec.python.internal.lib.tengo +1 -1
  18. package/dist/tengo/lib/exec.python.lib.tengo +37 -37
  19. package/dist/tengo/lib/exec.runcmd.lib.tengo +138 -138
  20. package/dist/tengo/lib/exec.runenv.lib.tengo +18 -18
  21. package/dist/tengo/lib/exec.stream.lib.tengo +25 -25
  22. package/dist/tengo/lib/feats.lib.tengo +3 -3
  23. package/dist/tengo/lib/file.internal.lib.tengo +31 -31
  24. package/dist/tengo/lib/file.lib.tengo +29 -29
  25. package/dist/tengo/lib/ll.get-future-field-default.lib.tengo +137 -0
  26. package/dist/tengo/lib/ll.lib.tengo +129 -129
  27. package/dist/tengo/lib/maps.lib.tengo +38 -38
  28. package/dist/tengo/lib/objects.lib.tengo +6 -6
  29. package/dist/tengo/lib/oop.lib.tengo +11 -11
  30. package/dist/tengo/lib/path.lib.tengo +60 -60
  31. package/dist/tengo/lib/pframes.builder.lib.tengo +3 -3
  32. package/dist/tengo/lib/pframes.constants.lib.tengo +20 -20
  33. package/dist/tengo/lib/pframes.export-pcolumn.lib.tengo +5 -5
  34. package/dist/tengo/lib/pframes.lib.tengo +206 -198
  35. package/dist/tengo/lib/pframes.ll.lib.tengo +59 -59
  36. package/dist/tengo/lib/pframes.pcolumn.lib.tengo +18 -18
  37. package/dist/tengo/lib/pframes.remove-nulls.lib.tengo +36 -0
  38. package/dist/tengo/lib/pframes.spec.lib.tengo +83 -83
  39. package/dist/tengo/lib/pframes.util.lib.tengo +176 -176
  40. package/dist/tengo/lib/pframes.xsv-import-file.lib.tengo +160 -0
  41. package/dist/tengo/lib/pframes.xsv.lib.tengo +84 -167
  42. package/dist/tengo/lib/render.lib.tengo +100 -45
  43. package/dist/tengo/lib/sets.lib.tengo +44 -44
  44. package/dist/tengo/lib/slices.lib.tengo +126 -126
  45. package/dist/tengo/lib/smart.lib.tengo +654 -507
  46. package/dist/tengo/lib/test.lib.tengo +120 -120
  47. package/dist/tengo/lib/tpl.lib.tengo +206 -170
  48. package/dist/tengo/lib/tpl.state-await.lib.tengo +17 -17
  49. package/dist/tengo/lib/tpl.util.lib.tengo +5 -5
  50. package/dist/tengo/lib/units.lib.tengo +2 -2
  51. package/dist/tengo/lib/validation.lib.tengo +130 -130
  52. package/dist/tengo/lib/waiter.lib.tengo +13 -13
  53. package/dist/tengo/lib/workdir.lib.tengo +126 -126
  54. package/dist/tengo/lib/workdir.proc.lib.tengo +47 -47
  55. package/dist/tengo/lib/workdir.save.lib.tengo +53 -53
  56. package/dist/tengo/lib/workflow.bobject.lib.tengo +11 -11
  57. package/dist/tengo/lib/workflow.bquery.lib.tengo +40 -40
  58. package/dist/tengo/lib/workflow.constants.lib.tengo +1 -1
  59. package/dist/tengo/lib/workflow.context.lib.tengo +16 -16
  60. package/dist/tengo/lib/workflow.lib.tengo +76 -76
  61. package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
  62. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  63. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  64. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  65. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  66. package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
  67. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  68. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  69. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  70. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  71. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  72. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  73. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  74. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  75. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  76. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  77. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  78. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  79. package/package.json +2 -2
  80. package/dist/tengo/tpl/pframes.map-pframe.plj.gz +0 -0
@@ -1,9 +1,9 @@
1
- /**
2
- * A library that creates Quota resource.
3
- * Shared with 'workdir' package.
4
- *
5
- * Was shaped as a separate lib to avoid recursive imports (exec -> workdir -> exec)
6
- */
1
+
2
+
3
+
4
+
5
+
6
+
7
7
 
8
8
  ll := import("@platforma-sdk/workflow-tengo:ll")
9
9
  oop := import("@platforma-sdk/workflow-tengo:oop")
@@ -14,11 +14,11 @@ json := import("json")
14
14
 
15
15
  _RTYPE_QUOTA := { Name: "Quota", Version: "1" }
16
16
 
17
- /**
18
- * Builder for quota resource.
19
- *
20
- * Creates 'Quota' resource used to request specific amount of CPU and RAM in a given queue
21
- */
17
+
18
+
19
+
20
+
21
+
22
22
  quotaBuilder := func() {
23
23
  self := undefined
24
24
 
@@ -28,13 +28,13 @@ quotaBuilder := func() {
28
28
 
29
29
 
30
30
  self = ll.toStrict({
31
- /**
32
- * Create quota resource for specific execution queue.
33
- * This is the only method required for call before .build()
34
- *
35
- * @param name: string - name of the queue.
36
- * @return builder
37
- */
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
38
  queue: func(name) {
39
39
  validation.assertType(name, "string", "exec.quota.builder.queue: name of the queue should be a string")
40
40
  queue_name = name
@@ -42,12 +42,12 @@ quotaBuilder := func() {
42
42
  return self
43
43
  },
44
44
 
45
- /**
46
- * Amount of cores to request in quota.
47
- *
48
- * @param amount: number - number of cores.
49
- * @return builder
50
- */
45
+
46
+
47
+
48
+
49
+
50
+
51
51
  cpu: func(amount) {
52
52
  validation.assertType(amount, ["or", "number", "null"], "exec.quota.builder.cpu: CPU amount should be a number")
53
53
  ll.assert(is_undefined(amount) || amount > 0, "exec.quota.builder.cpu: amount of cores should be greater than 0")
@@ -56,15 +56,15 @@ quotaBuilder := func() {
56
56
  return self
57
57
  },
58
58
 
59
- /**
60
- * Amount of RAM to request.
61
- *
62
- * @param amount: number | string - amount of RAM in bytes or string with size suffix (case-insensitive):
63
- * K, KB, M, MB, G, GB for base-10 sizes (x1000)
64
- * Ki, KiB, Mi, MiB, Gi, GiB for base-2 sizes (x1024)
65
- *
66
- * @return builder
67
- */
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
68
  ram: func(amount) {
69
69
  validation.assertType(amount, ["or", "number", "string", "null"], "exec.quota.builder.ram: RAM amount should be a number or string")
70
70
  ll.assert(is_undefined(amount) || is_string(amount) || amount > 0, "exec.quota.builder.ram: amount in bytes should be greater than 0")
@@ -73,11 +73,11 @@ quotaBuilder := func() {
73
73
  return self
74
74
  },
75
75
 
76
- /**
77
- * Create Quota resource.
78
- *
79
- * @return smart.resource - reference to the resulting value resource
80
- */
76
+
77
+
78
+
79
+
80
+
81
81
  build: func() {
82
82
  ll.assert(queue_name != "", "exec.quota.builder: queue name is mandatory and could not be empty string")
83
83
 
@@ -108,12 +108,12 @@ storageSpaceRequestBuilder := func() {
108
108
  quota := undefined
109
109
 
110
110
  self = ll.toStrict({
111
- /**
112
- * Request for given resources
113
- *
114
- * @param ref: smart.reference - reference to Quota resource to be fulfilled by storage allocator
115
- * @return spaceRequestBuilder
116
- */
111
+
112
+
113
+
114
+
115
+
116
+
117
117
  quota: func(ref) {
118
118
  validation.assertType(ref, validation.reference, "workdir.limits.quota: quota must be a valid reference to Quota resource")
119
119
  quota = ref
@@ -121,11 +121,11 @@ storageSpaceRequestBuilder := func() {
121
121
  return self
122
122
  },
123
123
 
124
- /**
125
- * Build StorageSpaceRequest resource
126
- *
127
- * @return StorageSpaceRequest
128
- */
124
+
125
+
126
+
127
+
128
+
129
129
  build: func() {
130
130
  ll.assert(smart.isReference(quota), "workdir.limits.build: quota of StorageSpaceRequest must be a valid reference")
131
131
 
@@ -1,4 +1,4 @@
1
- /** Contains a builder for monetization when we need to run monetization without exec (e.g. in pre-run). */
1
+
2
2
 
3
3
  ll := import("@platforma-sdk/workflow-tengo:ll")
4
4
  monetization := import("@platforma-sdk/workflow-tengo:exec.monetization_internal")
@@ -1,4 +1,4 @@
1
- /** The library provides all things to work with a monetization. */
1
+
2
2
 
3
3
  base64 := import("base64")
4
4
  json := import("json")
@@ -20,12 +20,12 @@ sets := import("@platforma-sdk/workflow-tengo:sets")
20
20
 
21
21
  _JWT_TOKEN_RESULT_ENV := "PLATFORMA_MNZ_JWT"
22
22
 
23
- /** mnz-client will print the response from milm to stdout as-is. */
23
+
24
24
  mnzClientStdoutSchema := ["or",
25
- // run-spec response
25
+
26
26
  { jwtToken: "string" },
27
27
 
28
- // dry-run response
28
+
29
29
  { mnz: {
30
30
  details: {
31
31
  spentRuns: "number",
@@ -40,19 +40,19 @@ mnzClientStdoutSchema := ["or",
40
40
  }}
41
41
  ]
42
42
 
43
- /** Just creates a new monetization as a map of params. */
43
+
44
44
  init := func() {
45
45
  return ll.toStrict({
46
46
  enabled: false,
47
47
 
48
- // product key of monetization
48
+
49
49
  productKey: "",
50
50
 
51
- // just returns a number of runs without the actual calculation.
52
- // Also, returns a number of remaining runs, a number of total runs etc.
51
+
52
+
53
53
  isDryRun: false,
54
54
 
55
- // file name to the param, e.g. {fileName: { arg: "dataset", collect: ["size", "lines", "sha256"] }}
55
+
56
56
  fileParams: {}
57
57
  })
58
58
  }
@@ -69,8 +69,8 @@ schema := {
69
69
  "fileParams": {"any": fileParamsSchema}
70
70
  }
71
71
 
72
- /** Same as validation.assertType(params, fileParamsSchema, ...),
73
- * but with prettier errors for clients. */
72
+
73
+
74
74
  _validateParams := func(params) {
75
75
  ll.assert(ll.isMap(params), "monetization.validateParams(): mnz params must be a map")
76
76
 
@@ -93,12 +93,12 @@ _validateIsReady := func(mnz) {
93
93
  ll.assert(len(mnz.productKey) > 0,
94
94
  "monetization.assertIsReady(): product key must be set")
95
95
 
96
- // We don't need it, since we could run software without file params
97
- // ll.assert(len(mnz.fileParams) > 0,
98
- // "monetization.assertIsReady(): at least 1 file param must be set")
96
+
97
+
98
+
99
99
  }
100
100
 
101
- /** Enables the monetization for a product. */
101
+
102
102
  enable := func(mnz, productKey) {
103
103
  ll.assert(is_string(productKey),
104
104
  "monetization.enable(): product key must be a string, got %v", productKey)
@@ -123,7 +123,7 @@ setDryRun := func(mnz, isDryRun) {
123
123
  mnz.isDryRun = isDryRun
124
124
  }
125
125
 
126
- /** Is this monetization enabled and should run? */
126
+
127
127
  shouldRun := func(mnz) {
128
128
  if mnz.enabled {
129
129
  _validateIsReady(mnz)
@@ -140,7 +140,7 @@ toJson := func(mnz) {
140
140
  return ll.fromStrict(mnz)
141
141
  }
142
142
 
143
- /** Adds monetization parameters by a file. */
143
+
144
144
  addFileParams := func(mnz, fileName, params) {
145
145
  validation.assertType(mnz, schema,
146
146
  "monetization.addFileParams(): monetization object does not fit json schema")
@@ -159,14 +159,14 @@ addFileParams := func(mnz, fileName, params) {
159
159
  mnz.fileParams[fileName] = params
160
160
  }
161
161
 
162
- /**
163
- * Runs monetization binary on a workdir with all files, and returns a new workdir and a resulted jwt token.
164
- * All resources are ephemeral,
165
- * the deduplication should be above this level.
166
- *
167
- * @param: mnz: monetization -- see a beginning of this file.
168
- * @param: wd: workdir -- workdir where all files from mnz.fileParams already exist.
169
- * @param: queue: queue - in which queue we should run monetization. */
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
170
  run := func(mnz, wd, queue) {
171
171
  _validateIsReady(mnz)
172
172
 
@@ -177,7 +177,7 @@ run := func(mnz, wd, queue) {
177
177
  builder.envTyped("MI_LICENSE", exprType, "{secrets.MI_LICENSE}")
178
178
 
179
179
  opts := internal.swToRunCmdOptions(mnzSw.name, mnzSw.version, mnzSw.descriptor)
180
- // load pkg var that points to mnz-client location.
180
+
181
181
  for _, varInfo in opts.variables {
182
182
  builder.ref(varInfo.refName, varInfo.reference)
183
183
  builder.substitutionRule(varInfo.varName, varInfo.refName)
@@ -185,7 +185,7 @@ run := func(mnz, wd, queue) {
185
185
 
186
186
  builder.cmdTyped(exprType, opts.cmd.value)
187
187
  for _, arg in opts.args {
188
- // now mnz-client doesn't have additional args; this line is just in case.
188
+
189
189
  builder.argTyped(exprType, arg)
190
190
  }
191
191
  if mnz.isDryRun {
@@ -193,9 +193,9 @@ run := func(mnz, wd, queue) {
193
193
  }
194
194
  builder.arg("-productKey").arg(mnz.productKey)
195
195
 
196
- // load file params
196
+
197
197
  for fileName, param in mnz.fileParams {
198
- // param is of fileParamsSchema type
198
+
199
199
  toCollect := text.join(param.collect, ",")
200
200
  arg := fmt.sprintf("%s:file:%s:%s", param.arg, fileName, toCollect)
201
201
  builder.arg(arg)
@@ -206,7 +206,7 @@ run := func(mnz, wd, queue) {
206
206
  builder.stdout(stdoutName)
207
207
  run := builder.build()
208
208
 
209
- // save mnz_stdout.txt
209
+
210
210
  savedWd := workdir.save(run.workdir).
211
211
  saveFileContent(stdoutName).
212
212
  build()
@@ -219,13 +219,13 @@ run := func(mnz, wd, queue) {
219
219
  )
220
220
 
221
221
  return ll.toStrict({
222
- // other commands should run on this wd,
223
- // or else they will run concurrently
224
- // with monetization.
222
+
223
+
224
+
225
225
  wdAfter: savedWd.workdir,
226
226
 
227
- // mnz-client returns jwt token
228
- // that we will pass to the next command as env.
227
+
228
+
229
229
  jwtEnvName: _JWT_TOKEN_RESULT_ENV,
230
230
  jwtEnvValue: result.output("jwtToken"),
231
231
 
@@ -233,18 +233,18 @@ run := func(mnz, wd, queue) {
233
233
  })
234
234
  }
235
235
 
236
- /** Gets mnz key from opts or undefined. */
236
+
237
237
  _extractOption := func(...opts) {
238
238
  if slices.length(opts) < 1 {
239
239
  return undefined
240
240
  }
241
241
  opt := opts[0]["mnz"]
242
242
 
243
- // readability if: we can return undefined here
243
+
244
244
  return is_undefined(opt) ? undefined : opt
245
245
  }
246
246
 
247
- /** Adds a monetization option if it's defined into mnzFileParams. */
247
+
248
248
  addOption := func(mnz, fileName, ...opts) {
249
249
  opt := _extractOption(opts...)
250
250
  if !is_undefined(opt) {
@@ -1,6 +1,6 @@
1
- /**
2
- * A library for working with platforma packages
3
- */
1
+
2
+
3
+
4
4
 
5
5
  ll := import("@platforma-sdk/workflow-tengo:ll")
6
6
  smart := import("@platforma-sdk/workflow-tengo:smart")
@@ -32,11 +32,11 @@ get := func(registryName, pkgName) {
32
32
 
33
33
  self := undefined
34
34
  self = oop.inherit(res, {
35
- /**
36
- * Reference to the software package archive downloaded by 'get'
37
- *
38
- * @return archive: field - output field, where info on downloaded archive will appear
39
- */
35
+
36
+
37
+
38
+
39
+
40
40
  archive: func() {
41
41
  return res.outputs()[_OUTPUT_ARCHIVE]
42
42
  }
@@ -59,11 +59,11 @@ install := func(archive) {
59
59
 
60
60
  self := undefined
61
61
  self = oop.inherit(res, {
62
- /**
63
- * Reference to installed package
64
- *
65
- * @return package: smart.field - output field, where installed package will appear
66
- */
62
+
63
+
64
+
65
+
66
+
67
67
  package: func() {
68
68
  return res.getField(_OUTPUT_PACKAGE)
69
69
  }
@@ -96,11 +96,11 @@ use := func(settings) {
96
96
 
97
97
  self := undefined
98
98
  self = oop.inherit(res, {
99
- /**
100
- * Reference to installed package
101
- *
102
- * @return package: field - output field, where installed package will appear
103
- */
99
+
100
+
101
+
102
+
103
+
104
104
  package: func() {
105
105
  return res.outputs()[_OUTPUT_PACKAGE]
106
106
  }
@@ -114,13 +114,13 @@ _INPUT_PACKAGE := "package"
114
114
  _INPUT_WD_IN := "workdirIn"
115
115
  _OUTPUT_WD_OUT := "workdirOut"
116
116
 
117
- /**
118
- * Load static files from software package into working directory or value resources.
119
- *
120
- * @param pkg: package - installed package (usually from package.install(<archive>))
121
- *
122
- * @return loader: pkgFileLoader - builder that provides requested files and content after load() call
123
- */
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
124
  pkgFileLoader := func(pkg) {
125
125
  ll.assert(smart.isReference(pkg),
126
126
  "package.pkgFileLoader: <pkg> must be reference to installed package. It is usually obtained from package.install().package")
@@ -191,22 +191,22 @@ pkgFileLoader := func(pkg) {
191
191
  filesContent: wdSave.filesContent,
192
192
  progress: wdSave.progress,
193
193
 
194
- /**
195
- * Retrieves selected asset file by its path (use saveFile() to provide asset as file)
196
- *
197
- * @param fileName: string
198
- * @return file: smart.field - a reference to the file resource.
199
- */
194
+
195
+
196
+
197
+
198
+
199
+
200
200
  getFile: func(fileName) {
201
201
  return wdSave.files.getFutureInputField(fileName)
202
202
  },
203
203
 
204
- /**
205
- * Retrieves selected asset data by its path (use saveFileContent() to provide asset's data)
206
- *
207
- * @param fileName: string
208
- * @return file: smart.field - a reference to the file resource.
209
- */
204
+
205
+
206
+
207
+
208
+
209
+
210
210
  getFileContent: func(fileName) {
211
211
  return wdSave.filesContent.getFutureInputField(fileName)
212
212
  }
@@ -217,14 +217,14 @@ pkgFileLoader := func(pkg) {
217
217
  return ll.toStrict(self)
218
218
  }
219
219
 
220
- /**
221
- * Load single asset by its path inside package, providing it as file.
222
- *
223
- * @param pkg: package - installed package (usually from package.install(<archive>))
224
- * @param assetPath: string - path to asset inside package <pkg>
225
- *
226
- * @return file: singleAsset - object with reference to the file resource and progress report
227
- */
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
228
  loadPackageFile := func(pkg, assetPath) {
229
229
  assets := pkgFileLoader(pkg).
230
230
  saveFile(assetPath).
@@ -236,14 +236,14 @@ loadPackageFile := func(pkg, assetPath) {
236
236
  }
237
237
  }
238
238
 
239
- /**
240
- * Load single asset by its path inside package, providing its raw content.
241
- *
242
- * @param pkg: package - installed package (usually from package.install(<archive>))
243
- * @param assetPath: string - path to asset inside package <pkg>
244
- *
245
- * @return content: singleAsset - object with reference to the asset content resource and progress report
246
- */
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
247
  loadPackageFileContent := func(pkg, assetPath) {
248
248
  assets := pkgFileLoader(pkg).
249
249
  saveFileContent(assetPath).
@@ -5,7 +5,7 @@ desc := import("@platforma-sdk/workflow-tengo:exec.descriptor")
5
5
  pythonVenvInputSchema := {
6
6
  toolset: "string",
7
7
  dependencies: {"any": validation.reference},
8
- // software: validation.reference,
8
+
9
9
 
10
10
  pythonDescriptor: desc.runEnvScheme,
11
11
  python: validation.reference
@@ -56,67 +56,67 @@ pythonVenvBuilder := func() {
56
56
  return self
57
57
  },
58
58
 
59
- /**
60
- * Sets the cache time in milliseconds.
61
- *
62
- * @param millis: number
63
- */
59
+
60
+
61
+
62
+
63
+
64
64
  cacheMillis: func(millis) {
65
65
  ll.assert(is_int(millis) && millis > 0, "exec.python.cacheMillis: cache time must be a number of milliseconds")
66
66
  cache = millis * times.millisecond
67
67
  return self
68
68
  },
69
69
 
70
- /**
71
- * Sets the cache time in seconds.
72
- *
73
- * @param seconds: number
74
- */
70
+
71
+
72
+
73
+
74
+
75
75
  cacheSeconds: func(seconds) {
76
76
  ll.assert(is_int(seconds) && seconds > 0, "exec.python.cacheSeconds: cache time must be a number of seconds")
77
77
  cache = seconds * times.second
78
78
  return self
79
79
  },
80
80
 
81
- /**
82
- * Sets the cache time in minutes.
83
- *
84
- * @param minutes: number
85
- */
81
+
82
+
83
+
84
+
85
+
86
86
  cacheMinutes: func(minutes) {
87
87
  ll.assert(is_int(minutes) && minutes > 0, "exec.python.cacheMinutes: cache time must be a number of minutes")
88
88
  cache = minutes * times.minute
89
89
  return self
90
90
  },
91
91
 
92
- /**
93
- * Sets the cache time in hours.
94
- *
95
- * @param hours: number
96
- */
92
+
93
+
94
+
95
+
96
+
97
97
  cacheHours: func(hours) {
98
98
  ll.assert(is_int(hours) && hours > 0, "exec.python.cacheHours: cache time must be a number of hours")
99
99
  cache = hours * times.hour
100
100
  return self
101
101
  },
102
102
 
103
- /**
104
- * Sets the cache time in days
105
- *
106
- * @param days: number
107
- */
103
+
104
+
105
+
106
+
107
+
108
108
  cacheDays: func(days) {
109
109
  ll.assert(is_int(days) && days > 0, "exec.python.cacheDays: cache time must be a number of days")
110
110
  cache = days * times.hour * 24
111
111
  return self
112
112
  },
113
113
 
114
- /**
115
- * @deprecated, use cacheMillis, cacheSeconds, cacheMinutes, cacheHours and cacheDays instead.
116
- * Sets the cache time.
117
- *
118
- * @param time: duration - the cache time from 'times' library.
119
- */
114
+
115
+
116
+
117
+
118
+
119
+
120
120
  cache: func(time) {
121
121
  ll.assert(
122
122
  is_int(time),
@@ -135,7 +135,7 @@ pythonVenvBuilder := func() {
135
135
  pyVenvInputs := {
136
136
  toolset: toolset,
137
137
  dependencies: depsMap,
138
- // software: softwareRef,
138
+
139
139
  pythonDescriptor: pythonDescriptor,
140
140
  python: pythonPkg
141
141
  }
@@ -146,11 +146,11 @@ pythonVenvBuilder := func() {
146
146
 
147
147
  self := undefined
148
148
  self = ll.toStrict(oop.inherit(tpl, {
149
- /**
150
- * Python virtual environment with all dependencies installed.
151
- *
152
- * @return venv: smart.field - a reference to the runenv with python venv inside.
153
- */
149
+
150
+
151
+
152
+
153
+
154
154
  venv: func() {
155
155
  return tpl.output(_OUTPUT_RUN_ENV, cache)
156
156
  }