kcl-lib 0.10.0b1__cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.10.0rc1__cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
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.
Potentially problematic release.
This version of kcl-lib might be problematic. Click here for more details.
- kcl_lib/_kcl_lib.cpython-311-aarch64-linux-gnu.so +0 -0
- kcl_lib/api/service.py +13 -54
- {kcl_lib-0.10.0b1.dist-info → kcl_lib-0.10.0rc1.dist-info}/METADATA +1 -3
- {kcl_lib-0.10.0b1.dist-info → kcl_lib-0.10.0rc1.dist-info}/RECORD +6 -6
- {kcl_lib-0.10.0b1.dist-info → kcl_lib-0.10.0rc1.dist-info}/WHEEL +1 -1
|
Binary file
|
kcl_lib/api/service.py
CHANGED
|
@@ -50,14 +50,15 @@ from google.protobuf import message as _message
|
|
|
50
50
|
class API:
|
|
51
51
|
"""KCL APIs
|
|
52
52
|
|
|
53
|
-
Examples
|
|
54
|
-
|
|
53
|
+
## Examples
|
|
54
|
+
|
|
55
|
+
Python Code
|
|
56
|
+
|
|
55
57
|
```python
|
|
56
58
|
import kcl_lib.api as api
|
|
57
|
-
# Call the `exec_program` method with appropriate arguments
|
|
58
59
|
args = api.ExecProgram_Args(k_filename_list=["a.k"])
|
|
59
|
-
# Usage
|
|
60
60
|
api = api.API()
|
|
61
|
+
|
|
61
62
|
result = api.exec_program(args)
|
|
62
63
|
print(result.yaml_result)
|
|
63
64
|
```
|
|
@@ -78,10 +79,9 @@ class API:
|
|
|
78
79
|
|
|
79
80
|
```python
|
|
80
81
|
schema AppConfig:
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
replicas: int
|
|
83
83
|
app: AppConfig {
|
|
84
|
-
|
|
84
|
+
replicas: 2
|
|
85
85
|
}
|
|
86
86
|
```
|
|
87
87
|
|
|
@@ -109,7 +109,6 @@ class API:
|
|
|
109
109
|
```python
|
|
110
110
|
schema AppConfig:
|
|
111
111
|
replicas: int
|
|
112
|
-
|
|
113
112
|
app: AppConfig {
|
|
114
113
|
replicas: 2
|
|
115
114
|
}
|
|
@@ -129,7 +128,6 @@ class API:
|
|
|
129
128
|
|
|
130
129
|
```python
|
|
131
130
|
import kcl_lib.api as api
|
|
132
|
-
|
|
133
131
|
try:
|
|
134
132
|
args = api.ExecProgram_Args(k_filename_list=["file_not_found"])
|
|
135
133
|
api = api.API()
|
|
@@ -141,12 +139,6 @@ class API:
|
|
|
141
139
|
"""
|
|
142
140
|
return self.call("KclvmService.ExecProgram", args)
|
|
143
141
|
|
|
144
|
-
def build_program(self, args: BuildProgram_Args) -> BuildProgram_Result:
|
|
145
|
-
return self.call("KclvmService.BuildProgram", args)
|
|
146
|
-
|
|
147
|
-
def exec_artifact(self, args: ExecArtifact_Args) -> ExecProgram_Result:
|
|
148
|
-
return self.call("KclvmService.ExecArtifact", args)
|
|
149
|
-
|
|
150
142
|
def parse_file(self, args: ParseFile_Args) -> ParseFile_Result:
|
|
151
143
|
"""Parse KCL single file to Module AST JSON string with import dependencies and parse errors.
|
|
152
144
|
|
|
@@ -157,7 +149,6 @@ class API:
|
|
|
157
149
|
```python
|
|
158
150
|
schema AppConfig:
|
|
159
151
|
replicas: int
|
|
160
|
-
|
|
161
152
|
app: AppConfig {
|
|
162
153
|
replicas: 2
|
|
163
154
|
}
|
|
@@ -187,7 +178,6 @@ class API:
|
|
|
187
178
|
```python
|
|
188
179
|
schema AppConfig:
|
|
189
180
|
replicas: int
|
|
190
|
-
|
|
191
181
|
app: AppConfig {
|
|
192
182
|
replicas: 2
|
|
193
183
|
}
|
|
@@ -217,7 +207,6 @@ class API:
|
|
|
217
207
|
```python
|
|
218
208
|
schema AppConfig:
|
|
219
209
|
replicas: int
|
|
220
|
-
|
|
221
210
|
app: AppConfig {
|
|
222
211
|
replicas: 2
|
|
223
212
|
}
|
|
@@ -227,7 +216,6 @@ class API:
|
|
|
227
216
|
|
|
228
217
|
```python
|
|
229
218
|
import kcl_lib.api as api
|
|
230
|
-
|
|
231
219
|
args = api.LoadPackage_Args(
|
|
232
220
|
parse_args=api.ParseProgram_Args(paths=["schema.k"]), resolve_ast=True
|
|
233
221
|
)
|
|
@@ -279,7 +267,6 @@ class API:
|
|
|
279
267
|
```python
|
|
280
268
|
schema AppConfig:
|
|
281
269
|
replicas: int
|
|
282
|
-
|
|
283
270
|
app: AppConfig {
|
|
284
271
|
replicas: 2
|
|
285
272
|
}
|
|
@@ -293,7 +280,6 @@ class API:
|
|
|
293
280
|
args = api.ListVariables_Args(files=[TEST_FILE])
|
|
294
281
|
api = api.API()
|
|
295
282
|
result = api.list_variables(args)
|
|
296
|
-
assert result.variables["app"].variables[0].value == "AppConfig {replicas: 2}"
|
|
297
283
|
```
|
|
298
284
|
"""
|
|
299
285
|
return self.call("KclvmService.ListVariables", args)
|
|
@@ -301,35 +287,18 @@ class API:
|
|
|
301
287
|
def format_code(self, args: FormatCode_Args) -> FormatCode_Result:
|
|
302
288
|
"""Format the code source.
|
|
303
289
|
|
|
304
|
-
|
|
305
|
-
<p>
|
|
290
|
+
## Example
|
|
306
291
|
|
|
307
292
|
Python Code
|
|
308
293
|
|
|
309
294
|
```python
|
|
310
295
|
import kcl_lib.api as api
|
|
311
|
-
|
|
312
|
-
source_code = \"\"\"schema Person:
|
|
313
|
-
name: str
|
|
314
|
-
age: int
|
|
315
|
-
|
|
316
|
-
check:
|
|
317
|
-
0 < age < 120
|
|
318
|
-
\"\"\"
|
|
296
|
+
source_code = "a = 1"
|
|
319
297
|
args = api.FormatCode_Args(source=source_code)
|
|
320
298
|
api_instance = api.API()
|
|
321
|
-
result = api_instance.format_code(args)
|
|
322
|
-
assert (
|
|
323
|
-
result.formatted.decode()
|
|
324
|
-
== \"\"\"schema Person:
|
|
325
|
-
name: str
|
|
326
|
-
age: int
|
|
327
|
-
|
|
328
|
-
check:
|
|
329
|
-
0 < age < 120
|
|
330
299
|
|
|
331
|
-
|
|
332
|
-
)
|
|
300
|
+
result = api_instance.format_code(args)
|
|
301
|
+
assert result.formatted.decode(), "a = 1"
|
|
333
302
|
```
|
|
334
303
|
"""
|
|
335
304
|
return self.call("KclvmService.FormatCode", args)
|
|
@@ -345,7 +314,6 @@ class API:
|
|
|
345
314
|
schema Person:
|
|
346
315
|
name: str
|
|
347
316
|
age: int
|
|
348
|
-
|
|
349
317
|
check:
|
|
350
318
|
0 < age < 120
|
|
351
319
|
```
|
|
@@ -373,7 +341,6 @@ class API:
|
|
|
373
341
|
```python
|
|
374
342
|
import math
|
|
375
343
|
|
|
376
|
-
a = 1
|
|
377
344
|
```
|
|
378
345
|
|
|
379
346
|
Python Code
|
|
@@ -397,7 +364,6 @@ class API:
|
|
|
397
364
|
|
|
398
365
|
```python
|
|
399
366
|
a = 1
|
|
400
|
-
|
|
401
367
|
b = {
|
|
402
368
|
"a": 1
|
|
403
369
|
"b": 2
|
|
@@ -442,7 +408,6 @@ class API:
|
|
|
442
408
|
```python
|
|
443
409
|
schema AppConfig:
|
|
444
410
|
replicas: int
|
|
445
|
-
|
|
446
411
|
app: AppConfig {
|
|
447
412
|
replicas: 2
|
|
448
413
|
}
|
|
@@ -475,7 +440,6 @@ class API:
|
|
|
475
440
|
schema Person:
|
|
476
441
|
name: str
|
|
477
442
|
age: int
|
|
478
|
-
|
|
479
443
|
check:
|
|
480
444
|
0 < age < 120
|
|
481
445
|
\"\"\"
|
|
@@ -511,7 +475,6 @@ class API:
|
|
|
511
475
|
|
|
512
476
|
```python
|
|
513
477
|
import kcl_lib.api as api
|
|
514
|
-
|
|
515
478
|
args = api.LoadSettingsFiles_Args(
|
|
516
479
|
work_dir=".", files=["kcl.yaml"]
|
|
517
480
|
)
|
|
@@ -531,9 +494,10 @@ class API:
|
|
|
531
494
|
|
|
532
495
|
## Example
|
|
533
496
|
|
|
534
|
-
The content of
|
|
497
|
+
The content of main.k is
|
|
535
498
|
|
|
536
499
|
```python
|
|
500
|
+
|
|
537
501
|
a = 1
|
|
538
502
|
b = a
|
|
539
503
|
```
|
|
@@ -542,7 +506,6 @@ class API:
|
|
|
542
506
|
|
|
543
507
|
```python
|
|
544
508
|
import kcl_lib.api as api
|
|
545
|
-
|
|
546
509
|
args = api.Rename_Args(
|
|
547
510
|
package_root=".",
|
|
548
511
|
symbol_path="a",
|
|
@@ -564,7 +527,6 @@ class API:
|
|
|
564
527
|
|
|
565
528
|
```python
|
|
566
529
|
import kcl_lib.api as api
|
|
567
|
-
|
|
568
530
|
args = api.RenameCode_Args(
|
|
569
531
|
package_root="/mock/path",
|
|
570
532
|
symbol_path="a",
|
|
@@ -620,7 +582,6 @@ class API:
|
|
|
620
582
|
|
|
621
583
|
```python
|
|
622
584
|
import kcl_lib.api as api
|
|
623
|
-
|
|
624
585
|
args = api.UpdateDependencies_Args(
|
|
625
586
|
manifest_path="module"
|
|
626
587
|
)
|
|
@@ -652,7 +613,6 @@ class API:
|
|
|
652
613
|
```python
|
|
653
614
|
import helloworld
|
|
654
615
|
import flask
|
|
655
|
-
|
|
656
616
|
a = helloworld.The_first_kcl_program
|
|
657
617
|
```
|
|
658
618
|
|
|
@@ -660,7 +620,6 @@ class API:
|
|
|
660
620
|
|
|
661
621
|
```python
|
|
662
622
|
import kcl_lib.api as api
|
|
663
|
-
|
|
664
623
|
args = api.UpdateDependencies_Args(
|
|
665
624
|
manifest_path="module"
|
|
666
625
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: kcl_lib
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.0rc1
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -248,7 +248,6 @@ import kcl_lib.api as api
|
|
|
248
248
|
args = api.ListVariables_Args(files=[TEST_FILE])
|
|
249
249
|
api = api.API()
|
|
250
250
|
result = api.list_variables(args)
|
|
251
|
-
assert result.variables["app"].variables[0].value == "AppConfig {replicas: 2}"
|
|
252
251
|
```
|
|
253
252
|
|
|
254
253
|
</p>
|
|
@@ -332,7 +331,6 @@ The content of `main.k` is
|
|
|
332
331
|
|
|
333
332
|
```python
|
|
334
333
|
a = 1
|
|
335
|
-
|
|
336
334
|
b = {
|
|
337
335
|
"a": 1
|
|
338
336
|
"b": 2
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
kcl_lib-0.10.
|
|
2
|
-
kcl_lib-0.10.
|
|
3
|
-
kcl_lib/api/service.py,sha256=ELOtfoIIuiQ7YBoPSTNGNgkNg_mX_vcNLlPCgpUlDcE,23665
|
|
1
|
+
kcl_lib-0.10.0rc1.dist-info/METADATA,sha256=LcVsSczyAc8tOa9-zoaqF7ax3UCx-LBPJ4Ncbi4qwp4,12020
|
|
2
|
+
kcl_lib-0.10.0rc1.dist-info/WHEEL,sha256=8djTTLlmsQQAWq4FjpqYdEnWESxPUJ7xizommrmEAaE,131
|
|
4
3
|
kcl_lib/api/spec_pb2.py,sha256=aenuWIgVxBbwj5nesgB4cPYPwNPxEnF-Ns8QC16Fap0,28145
|
|
5
4
|
kcl_lib/api/spec_pb2.pyi,sha256=SICDHsPDw7ygxFvBFUE9wU7BNUHUTkAskHUgMunO7hE,39503
|
|
5
|
+
kcl_lib/api/service.py,sha256=Phgae8NUgsCsnHU9TMpDdOWcL3I-KETJqN53tXFxr-A,22878
|
|
6
6
|
kcl_lib/api/__init__.py,sha256=xDhj649QOL-WIXjGyGACSBrUZCZwf51gjUlnsJQNNyI,2865
|
|
7
|
-
kcl_lib/__init__.py,sha256=3EKn2Bb6NvoajnhLym-yQiobUBgdnj46bhe5u_GYo5A,24
|
|
8
7
|
kcl_lib/plugin/__init__.py,sha256=8n67HzfKI8I2E-OWZmE68ZRh88Jzq-Pc61qAmCdMUj8,125
|
|
9
8
|
kcl_lib/plugin/plugin.py,sha256=shHQS4atDxfctMOinoSUOO6Z568P9xB7BoT_aNn-xOw,2505
|
|
10
|
-
kcl_lib/
|
|
11
|
-
kcl_lib-
|
|
9
|
+
kcl_lib/__init__.py,sha256=3EKn2Bb6NvoajnhLym-yQiobUBgdnj46bhe5u_GYo5A,24
|
|
10
|
+
kcl_lib/_kcl_lib.cpython-311-aarch64-linux-gnu.so,sha256=kKQALqBk6Y4LXs9mZ0ttr62_zI6QTwvxSp16LXy8DkQ,22534856
|
|
11
|
+
kcl_lib-0.10.0rc1.dist-info/RECORD,,
|