@platforma-sdk/workflow-tengo 2.9.6 → 2.9.8

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 (64) hide show
  1. package/dist/tengo/lib/assets.lib.tengo +52 -52
  2. package/dist/tengo/lib/assets.swinfo.lib.tengo +45 -45
  3. package/dist/tengo/lib/constants.lib.tengo +32 -32
  4. package/dist/tengo/lib/exec.R.internal.lib.tengo +29 -29
  5. package/dist/tengo/lib/exec.R.lib.tengo +166 -166
  6. package/dist/tengo/lib/exec.constants.lib.tengo +4 -4
  7. package/dist/tengo/lib/exec.descriptor.lib.tengo +31 -31
  8. package/dist/tengo/lib/exec.internal.lib.tengo +297 -297
  9. package/dist/tengo/lib/exec.lib.tengo +815 -815
  10. package/dist/tengo/lib/exec.monetization.lib.tengo +130 -130
  11. package/dist/tengo/lib/exec.package.lib.tengo +212 -212
  12. package/dist/tengo/lib/exec.python.internal.lib.tengo +6 -6
  13. package/dist/tengo/lib/exec.python.lib.tengo +146 -146
  14. package/dist/tengo/lib/exec.runcmd.lib.tengo +371 -371
  15. package/dist/tengo/lib/exec.runenv.lib.tengo +92 -92
  16. package/dist/tengo/lib/exec.stream.lib.tengo +40 -40
  17. package/dist/tengo/lib/file.internal.lib.tengo +77 -77
  18. package/dist/tengo/lib/file.lib.tengo +57 -57
  19. package/dist/tengo/lib/ll.lib.tengo +244 -244
  20. package/dist/tengo/lib/maps.lib.tengo +152 -152
  21. package/dist/tengo/lib/objects.lib.tengo +13 -13
  22. package/dist/tengo/lib/oop.lib.tengo +19 -19
  23. package/dist/tengo/lib/path.lib.tengo +125 -125
  24. package/dist/tengo/lib/pframes.constants.lib.tengo +28 -28
  25. package/dist/tengo/lib/pframes.export-pcolumn.lib.tengo +33 -33
  26. package/dist/tengo/lib/pframes.lib.tengo +43 -43
  27. package/dist/tengo/lib/pframes.ll.lib.tengo +72 -72
  28. package/dist/tengo/lib/pframes.pcolumn.lib.tengo +49 -49
  29. package/dist/tengo/lib/pframes.spec.lib.tengo +96 -96
  30. package/dist/tengo/lib/pframes.util.lib.tengo +288 -288
  31. package/dist/tengo/lib/pframes.xsv.lib.tengo +272 -272
  32. package/dist/tengo/lib/render.lib.tengo +75 -75
  33. package/dist/tengo/lib/sets.lib.tengo +68 -68
  34. package/dist/tengo/lib/slices.lib.tengo +258 -155
  35. package/dist/tengo/lib/smart.lib.tengo +1069 -1069
  36. package/dist/tengo/lib/test.lib.tengo +161 -161
  37. package/dist/tengo/lib/tpl.lib.tengo +515 -515
  38. package/dist/tengo/lib/tpl.state-await.lib.tengo +240 -240
  39. package/dist/tengo/lib/tpl.util.lib.tengo +9 -9
  40. package/dist/tengo/lib/validation.lib.tengo +378 -378
  41. package/dist/tengo/lib/workdir.lib.tengo +331 -331
  42. package/dist/tengo/lib/workdir.proc.lib.tengo +144 -144
  43. package/dist/tengo/lib/workdir.save.lib.tengo +130 -130
  44. package/dist/tengo/lib/workflow.bobject.lib.tengo +26 -26
  45. package/dist/tengo/lib/workflow.bquery.lib.tengo +165 -165
  46. package/dist/tengo/lib/workflow.constants.lib.tengo +2 -2
  47. package/dist/tengo/lib/workflow.context.lib.tengo +32 -32
  48. package/dist/tengo/lib/workflow.lib.tengo +206 -206
  49. package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
  50. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  51. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  52. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  53. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  54. package/dist/tengo/tpl/pframes.aggregate.plj.gz +0 -0
  55. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  56. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  57. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  58. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  59. package/dist/tengo/tpl/pframes.map-pframe.plj.gz +0 -0
  60. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  61. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  62. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  63. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  64. package/package.json +2 -2
@@ -16,153 +16,153 @@ _OUTPUT_RUN_ENV := "runEnv"
16
16
  createVenvTpl := assets.importTemplate("@platforma-sdk/workflow-tengo:exec.python.create-venv")
17
17
 
18
18
  pythonVenvBuilder := func() {
19
- self := undefined
20
-
21
- toolset := "pip"
22
- pythonDescriptor := undefined
23
- softwareRef := undefined
24
- dependencies := undefined
25
- cache := 0
26
-
27
- self = {
28
- useToolset: func(name) {
29
- validation.assertJsonSchema(name, "string",
30
- "exec.python.useToolset: <name> must be valid name of python packaging toolset (pip, pipenv and so on)")
31
- ll.assert(name != "", "exec.python.useToolset: toolset name must not be empty")
32
-
33
- toolset = name
34
- return self
35
- },
36
-
37
- runEnvDescriptor: func(descriptor) {
38
- validation.assertJsonSchema(descriptor, desc.runEnvScheme, "exec.python.runEnvDescriptor: <descriptor> must be run environment specification")
39
- ll.assert(descriptor.type == "python", "exec.python.runEnvDescriptor: not a 'python' run environment: %q", descriptor.type)
40
-
41
- pythonDescriptor = ll.fromStrict(descriptor)
42
- return self
43
- },
44
-
45
- software: func(pkgRef) {
46
- validation.assertJsonSchema(pkgRef, validation.reference, "exec.python.software: <pkgRef> must be a reference to software package")
47
-
48
- softwareRef = pkgRef
49
- return self
50
- },
51
-
52
- dependencies: func(deps) {
53
- validation.assertJsonSchema(deps, { "any": "string" }, "exec.python.dependencies: <deps> must be map of reference file paths")
54
-
55
- dependencies = deps
56
- return self
57
- },
58
-
59
-
60
-
61
-
62
-
63
-
64
- cacheMillis: func(millis) {
65
- ll.assert(is_int(millis) && millis > 0, "exec.python.cacheMillis: cache time must be a number of milliseconds")
66
- cache = millis * times.millisecond
67
- return self
68
- },
69
-
70
-
71
-
72
-
73
-
74
-
75
- cacheSeconds: func(seconds) {
76
- ll.assert(is_int(seconds) && seconds > 0, "exec.python.cacheSeconds: cache time must be a number of seconds")
77
- cache = seconds * times.second
78
- return self
79
- },
80
-
81
-
82
-
83
-
84
-
85
-
86
- cacheMinutes: func(minutes) {
87
- ll.assert(is_int(minutes) && minutes > 0, "exec.python.cacheMinutes: cache time must be a number of minutes")
88
- cache = minutes * times.minute
89
- return self
90
- },
91
-
92
-
93
-
94
-
95
-
96
-
97
- cacheHours: func(hours) {
98
- ll.assert(is_int(hours) && hours > 0, "exec.python.cacheHours: cache time must be a number of hours")
99
- cache = hours * times.hour
100
- return self
101
- },
102
-
103
-
104
-
105
-
106
-
107
-
108
- cacheDays: func(days) {
109
- ll.assert(is_int(days) && days > 0, "exec.python.cacheDays: cache time must be a number of days")
110
- cache = days * times.hour * 24
111
- return self
112
- },
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
- cache: func(time) {
121
- ll.assert(
122
- is_int(time),
123
- "exec.python.cache: cache time must be an integer. " +
124
- "Did you forget to import a standard tengo library 'times'?")
125
- cache = time
126
- return self
127
- },
128
-
129
- build: func() {
130
- depsMap := runenv.loadDependencyFiles(softwareRef, dependencies)
131
-
132
- archive := pkg.get(pythonDescriptor.registry, pythonDescriptor.package).archive()
133
- pythonPkg := pkg.install(archive).package()
134
-
135
- pyVenvInputs := {
136
- toolset: toolset,
137
- dependencies: depsMap,
138
-
139
- pythonDescriptor: pythonDescriptor,
140
- python: pythonPkg
141
- }
142
-
143
- validation.assertJsonSchema(pyVenvInputs, internal.pythonVenvInputSchema, "incomplete python runenv configuration")
144
-
145
- tpl := render.create(createVenvTpl, pyVenvInputs)
146
-
147
- self := undefined
148
- self = ll.toStrict(oop.inherit(tpl, {
149
-
150
-
151
-
152
-
153
-
154
- venv: func() {
155
- return tpl.output(_OUTPUT_RUN_ENV, cache)
156
- }
157
- }))
158
-
159
- return self
160
- }
161
- }
162
-
163
- return self
19
+ self := undefined
20
+
21
+ toolset := "pip"
22
+ pythonDescriptor := undefined
23
+ softwareRef := undefined
24
+ dependencies := undefined
25
+ cache := 0
26
+
27
+ self = {
28
+ useToolset: func(name) {
29
+ validation.assertJsonSchema(name, "string",
30
+ "exec.python.useToolset: <name> must be valid name of python packaging toolset (pip, pipenv and so on)")
31
+ ll.assert(name != "", "exec.python.useToolset: toolset name must not be empty")
32
+
33
+ toolset = name
34
+ return self
35
+ },
36
+
37
+ runEnvDescriptor: func(descriptor) {
38
+ validation.assertJsonSchema(descriptor, desc.runEnvScheme, "exec.python.runEnvDescriptor: <descriptor> must be run environment specification")
39
+ ll.assert(descriptor.type == "python", "exec.python.runEnvDescriptor: not a 'python' run environment: %q", descriptor.type)
40
+
41
+ pythonDescriptor = ll.fromStrict(descriptor)
42
+ return self
43
+ },
44
+
45
+ software: func(pkgRef) {
46
+ validation.assertJsonSchema(pkgRef, validation.reference, "exec.python.software: <pkgRef> must be a reference to software package")
47
+
48
+ softwareRef = pkgRef
49
+ return self
50
+ },
51
+
52
+ dependencies: func(deps) {
53
+ validation.assertJsonSchema(deps, { "any": "string" }, "exec.python.dependencies: <deps> must be map of reference file paths")
54
+
55
+ dependencies = deps
56
+ return self
57
+ },
58
+
59
+ /**
60
+ * Sets the cache time in milliseconds.
61
+ *
62
+ * @param millis: number
63
+ */
64
+ cacheMillis: func(millis) {
65
+ ll.assert(is_int(millis) && millis > 0, "exec.python.cacheMillis: cache time must be a number of milliseconds")
66
+ cache = millis * times.millisecond
67
+ return self
68
+ },
69
+
70
+ /**
71
+ * Sets the cache time in seconds.
72
+ *
73
+ * @param seconds: number
74
+ */
75
+ cacheSeconds: func(seconds) {
76
+ ll.assert(is_int(seconds) && seconds > 0, "exec.python.cacheSeconds: cache time must be a number of seconds")
77
+ cache = seconds * times.second
78
+ return self
79
+ },
80
+
81
+ /**
82
+ * Sets the cache time in minutes.
83
+ *
84
+ * @param minutes: number
85
+ */
86
+ cacheMinutes: func(minutes) {
87
+ ll.assert(is_int(minutes) && minutes > 0, "exec.python.cacheMinutes: cache time must be a number of minutes")
88
+ cache = minutes * times.minute
89
+ return self
90
+ },
91
+
92
+ /**
93
+ * Sets the cache time in hours.
94
+ *
95
+ * @param hours: number
96
+ */
97
+ cacheHours: func(hours) {
98
+ ll.assert(is_int(hours) && hours > 0, "exec.python.cacheHours: cache time must be a number of hours")
99
+ cache = hours * times.hour
100
+ return self
101
+ },
102
+
103
+ /**
104
+ * Sets the cache time in days
105
+ *
106
+ * @param days: number
107
+ */
108
+ cacheDays: func(days) {
109
+ ll.assert(is_int(days) && days > 0, "exec.python.cacheDays: cache time must be a number of days")
110
+ cache = days * times.hour * 24
111
+ return self
112
+ },
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
+ */
120
+ cache: func(time) {
121
+ ll.assert(
122
+ is_int(time),
123
+ "exec.python.cache: cache time must be an integer. " +
124
+ "Did you forget to import a standard tengo library 'times'?")
125
+ cache = time
126
+ return self
127
+ },
128
+
129
+ build: func() {
130
+ depsMap := runenv.loadDependencyFiles(softwareRef, dependencies)
131
+
132
+ archive := pkg.get(pythonDescriptor.registry, pythonDescriptor.package).archive()
133
+ pythonPkg := pkg.install(archive).package()
134
+
135
+ pyVenvInputs := {
136
+ toolset: toolset,
137
+ dependencies: depsMap,
138
+ // software: softwareRef,
139
+ pythonDescriptor: pythonDescriptor,
140
+ python: pythonPkg
141
+ }
142
+
143
+ validation.assertJsonSchema(pyVenvInputs, internal.pythonVenvInputSchema, "incomplete python runenv configuration")
144
+
145
+ tpl := render.create(createVenvTpl, pyVenvInputs)
146
+
147
+ self := undefined
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
+ */
154
+ venv: func() {
155
+ return tpl.output(_OUTPUT_RUN_ENV, cache)
156
+ }
157
+ }))
158
+
159
+ return self
160
+ }
161
+ }
162
+
163
+ return self
164
164
  }
165
165
 
166
166
  export ll.toStrict({
167
- venvBuilder : pythonVenvBuilder
167
+ venvBuilder : pythonVenvBuilder
168
168
  })