UncountablePythonSDK 0.0.17__py3-none-any.whl → 0.0.19__py3-none-any.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 UncountablePythonSDK might be problematic. Click here for more details.
- {UncountablePythonSDK-0.0.17.dist-info → UncountablePythonSDK-0.0.19.dist-info}/METADATA +2 -2
- {UncountablePythonSDK-0.0.17.dist-info → UncountablePythonSDK-0.0.19.dist-info}/RECORD +42 -31
- pkgs/argument_parser/_is_enum.py +1 -1
- pkgs/argument_parser/argument_parser.py +13 -13
- pkgs/serialization/serial_class.py +3 -3
- pkgs/serialization_util/_get_type_for_serialization.py +1 -3
- pkgs/serialization_util/serialization_helpers.py +1 -3
- pkgs/strenum_compat/strenum_compat.py +1 -9
- pkgs/type_spec/actions_registry/__main__.py +9 -3
- pkgs/type_spec/actions_registry/emit_typescript.py +20 -6
- pkgs/type_spec/builder.py +10 -10
- pkgs/type_spec/config.py +3 -2
- pkgs/type_spec/emit_python.py +19 -16
- pkgs/type_spec/emit_typescript.py +2 -2
- pkgs/type_spec/emit_typescript_util.py +1 -2
- pkgs/type_spec/load_types.py +2 -1
- pkgs/type_spec/open_api_util.py +2 -2
- pkgs/type_spec/parts/base.py.prepart +2 -1
- pkgs/type_spec/util.py +9 -9
- pkgs/type_spec/value_spec/__main__.py +2 -2
- type_spec/external/api/batch/execute_batch_load_async.yaml +18 -0
- type_spec/external/api/id_source/list_id_source.yaml +35 -0
- type_spec/external/api/id_source/match_id_source.yaml +32 -0
- type_spec/external/api/recipes/create_recipe.yaml +3 -0
- type_spec/external/api/recipes/get_recipes_data.yaml +21 -21
- type_spec/external/api/recipes/set_recipe_inputs.yaml +3 -0
- type_spec/external/api/triggers/run_trigger.yaml +18 -0
- uncountable/types/__init__.py +10 -0
- uncountable/types/api/batch/execute_batch_load_async.py +35 -0
- uncountable/types/api/id_source/__init__.py +1 -0
- uncountable/types/api/id_source/list_id_source.py +46 -0
- uncountable/types/api/id_source/match_id_source.py +48 -0
- uncountable/types/api/recipes/create_recipe.py +2 -0
- uncountable/types/api/recipes/set_recipe_inputs.py +1 -0
- uncountable/types/api/triggers/__init__.py +1 -0
- uncountable/types/api/triggers/run_trigger.py +36 -0
- uncountable/types/async_batch.py +22 -0
- uncountable/types/base.py +2 -1
- uncountable/types/client_base.py +102 -1
- uncountable/types/id_source.py +49 -0
- {UncountablePythonSDK-0.0.17.dist-info → UncountablePythonSDK-0.0.19.dist-info}/WHEEL +0 -0
- {UncountablePythonSDK-0.0.17.dist-info → UncountablePythonSDK-0.0.19.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: UncountablePythonSDK
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.19
|
|
4
4
|
Summary: Uncountable SDK
|
|
5
5
|
Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
|
|
6
6
|
Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
|
|
@@ -17,7 +17,7 @@ Classifier: Typing :: Typed
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
Requires-Dist: requests ==2.31.0
|
|
20
|
-
Requires-Dist: SQLAlchemy ==
|
|
20
|
+
Requires-Dist: SQLAlchemy ==1.4.52
|
|
21
21
|
Requires-Dist: APScheduler ==3.10.4
|
|
22
22
|
Requires-Dist: python-dateutil ==2.9.0
|
|
23
23
|
Requires-Dist: shelljob ==0.6.3
|
|
@@ -18,46 +18,47 @@ examples/create_entity.py,sha256=54AmZt83EpypxGcYZSIMmWlGz2oAgHFOsKuLSZOcHsI,625
|
|
|
18
18
|
examples/recipe-import/importer.py,sha256=baD71xuNibxDTe3bGHsMEIZEf9Xtb-IumBNpCEV0RZU,1134
|
|
19
19
|
pkgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
pkgs/argument_parser/__init__.py,sha256=CsQ6QoPKSLLRVl-z6URAmPkiUL9ZPZoV4rJHgy_-RjA,385
|
|
21
|
-
pkgs/argument_parser/_is_enum.py,sha256=
|
|
21
|
+
pkgs/argument_parser/_is_enum.py,sha256=Gw6jJa8nBwYGqXwwCZbSnWL8Rvr5alkg5lSVAqXtOZM,257
|
|
22
22
|
pkgs/argument_parser/_is_namedtuple.py,sha256=Rjc1bKanIPPogl3qG5JPBxglG1TqWYOo1nxxhBASQWY,265
|
|
23
|
-
pkgs/argument_parser/argument_parser.py,sha256=
|
|
23
|
+
pkgs/argument_parser/argument_parser.py,sha256=MZ3fxClPErZVfg_Aq48ck32evHVuAzq9N_108nO6MIA,14677
|
|
24
24
|
pkgs/argument_parser/case_convert.py,sha256=J9wahIE-P95LvTqn4M4gDUx_RXeiW2SRo9i_1bz1E6A,558
|
|
25
25
|
pkgs/serialization/__init__.py,sha256=quvXMSl1szddLTr4Yxo9KA9oBMoeX7qGpFkkAplFBbY,603
|
|
26
26
|
pkgs/serialization/missing_sentry.py,sha256=aM_9KxbCk9dVvXvcOKgkIQBqFWvLhv8QlIUCiuFEXMo,806
|
|
27
27
|
pkgs/serialization/opaque_key.py,sha256=FIfXEE0DA1U8R_taFbQ1RCoTSgehrPjP06-qvo-GeNQ,177
|
|
28
|
-
pkgs/serialization/serial_class.py,sha256=
|
|
28
|
+
pkgs/serialization/serial_class.py,sha256=19UIvz2XPT4k1uXtScyjVfdhfvpehZOcjV6Z27p_VFQ,5193
|
|
29
29
|
pkgs/serialization_util/__init__.py,sha256=4vX5j1pvd1NkznSVqwWqunVyOvQtLCgVuwRjVwDk7qg,447
|
|
30
|
-
pkgs/serialization_util/_get_type_for_serialization.py,sha256=
|
|
31
|
-
pkgs/serialization_util/serialization_helpers.py,sha256=
|
|
30
|
+
pkgs/serialization_util/_get_type_for_serialization.py,sha256=dW5_W9MFd6wgWfW5qlWork-GBb-QFLtiOZkjk2Zqn2M,1177
|
|
31
|
+
pkgs/serialization_util/serialization_helpers.py,sha256=koyGyvdlEmGFK1BUiHtM2gTzAyHygbe1JpKLdZ-Aw84,5124
|
|
32
32
|
pkgs/strenum_compat/__init__.py,sha256=wXRFeNvBm8RU6dy1PFJ5sRLgUIEeH_DVR95Sv5qpGbk,59
|
|
33
|
-
pkgs/strenum_compat/strenum_compat.py,sha256=
|
|
33
|
+
pkgs/strenum_compat/strenum_compat.py,sha256=uOUAgpYTjHs1MX8dG81jRlyTkt3KNbkV_25zp7xTX2s,36
|
|
34
34
|
pkgs/type_spec/__init__.py,sha256=h5DmJTca4QVV10sZR1x0-MlkZfuGYDfapR3zHvXfzto,19
|
|
35
35
|
pkgs/type_spec/__main__.py,sha256=5bJaX9Y_-FavP0qwzhk-z-V97UY7uaezJTa1zhO_HHQ,1048
|
|
36
|
-
pkgs/type_spec/builder.py,sha256=
|
|
37
|
-
pkgs/type_spec/config.py,sha256=
|
|
36
|
+
pkgs/type_spec/builder.py,sha256=vzJdNkv5kqvbpho9Lb3JpcRyabxSIU7crTwulksAUFY,39127
|
|
37
|
+
pkgs/type_spec/config.py,sha256=TOcXjq9Yp8nYXAVgGz_qOBjqsxQLAO5YqHIYiCpdkr4,4955
|
|
38
38
|
pkgs/type_spec/emit_io_ts.py,sha256=gCEfS81w_ifqjLVJ3_cpy9Gq03o6H5nEsh35WAkqGGE,5606
|
|
39
39
|
pkgs/type_spec/emit_open_api.py,sha256=dnGazdVBjdEWQ4WK8Ujq966quRZY2TyQ05PGR48Md2I,17461
|
|
40
40
|
pkgs/type_spec/emit_open_api_util.py,sha256=xnzPOuPO8Pbhf6xf1tkHUKgXs1n-jH-lWFac8pOtd4I,1882
|
|
41
|
-
pkgs/type_spec/emit_python.py,sha256=
|
|
42
|
-
pkgs/type_spec/emit_typescript.py,sha256=
|
|
43
|
-
pkgs/type_spec/emit_typescript_util.py,sha256=
|
|
44
|
-
pkgs/type_spec/load_types.py,sha256=
|
|
45
|
-
pkgs/type_spec/open_api_util.py,sha256=
|
|
41
|
+
pkgs/type_spec/emit_python.py,sha256=bJMiz_OEeTklFxEuBjDIg-E_g6vVKx30b-JKSudAi5g,36719
|
|
42
|
+
pkgs/type_spec/emit_typescript.py,sha256=KOCcPuwSLRSt3pIp06Nq9exledq-kWtrA4RnUpeGMi8,17505
|
|
43
|
+
pkgs/type_spec/emit_typescript_util.py,sha256=93FzJnpYse4PKFzgdw4DGV4zFTi5tF4WR-CIi7cW498,873
|
|
44
|
+
pkgs/type_spec/load_types.py,sha256=AB334CF-368dpMNXE2QIFT7WxESvuew2RK_GG2MREng,2211
|
|
45
|
+
pkgs/type_spec/open_api_util.py,sha256=88zgI_lHi6SjCaNfKpoiCjd1o0Npysjk-7iCXw0a3Hs,7463
|
|
46
46
|
pkgs/type_spec/test.py,sha256=4ueujBq-pEgnX3Z69HyPmD-bullFXmpixcpVzfOkhP4,489
|
|
47
|
-
pkgs/type_spec/util.py,sha256=
|
|
47
|
+
pkgs/type_spec/util.py,sha256=6m6MPfY-SwjyZf2FWQKclswWB5o7gcdd-3tdpViPYOQ,4844
|
|
48
48
|
pkgs/type_spec/actions_registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
-
pkgs/type_spec/actions_registry/__main__.py,sha256=
|
|
50
|
-
pkgs/type_spec/actions_registry/emit_typescript.py,sha256=
|
|
51
|
-
pkgs/type_spec/parts/base.py.prepart,sha256=
|
|
49
|
+
pkgs/type_spec/actions_registry/__main__.py,sha256=3VPSxW6MfnOXhsSGpsbeswdsLHHuD1nOt3IYuXkb6ME,3809
|
|
50
|
+
pkgs/type_spec/actions_registry/emit_typescript.py,sha256=Tt-XQVaCHE1bQIGBYzzurdMqOZSUyrL4qttMyW7MYD4,4229
|
|
51
|
+
pkgs/type_spec/parts/base.py.prepart,sha256=wGNoDyQnLolHRZGRwHQX5TrPfKnu558NXCocYvqyroc,2174
|
|
52
52
|
pkgs/type_spec/parts/base.ts.prepart,sha256=2FJJvpg2olCcavxj0nbYWdwKl6KeScour2JjSvN42l8,1001
|
|
53
53
|
pkgs/type_spec/type_info/__main__.py,sha256=pmVjVqXyVh8vKTNCTFgz80Sg74C5BKToP3E6GS-X_So,857
|
|
54
54
|
pkgs/type_spec/type_info/emit_type_info.py,sha256=xWcZsgdEwApqqvtinZXyyBM61FZ9rmP9oybKapz8xN4,7692
|
|
55
55
|
pkgs/type_spec/value_spec/__init__.py,sha256=Z-grlcZtxAfEXhPHsK0nD7PFLGsv4eqvunaPN7_TA84,83
|
|
56
|
-
pkgs/type_spec/value_spec/__main__.py,sha256
|
|
56
|
+
pkgs/type_spec/value_spec/__main__.py,sha256=-9L5pXYx02plnTetqNknaUZPieLRtzbyWdZDT6B-cWA,8294
|
|
57
57
|
pkgs/type_spec/value_spec/convert_type.py,sha256=SAYyEV6orQJJbkXSE4hhtOQJ2vKUXJCKPeYPrB8G9oA,2272
|
|
58
58
|
pkgs/type_spec/value_spec/emit_python.py,sha256=rjg6LIGYdaagrZ19XpDfW_Z7LPNwCMDceBje5dsMFbw,6959
|
|
59
59
|
pkgs/type_spec/value_spec/types.py,sha256=a2zxbbCRWepY1l8OtjeCDKgBKFPFHVgV99oP6pTtaro,441
|
|
60
60
|
type_spec/external/api/batch/execute_batch.yaml,sha256=gpdSev3sLEC_cMVSZdj-9bc_XDFDqdPdOII9Ojme2N8,1170
|
|
61
|
+
type_spec/external/api/batch/execute_batch_load_async.yaml,sha256=gcn51NWLiSvlytz8k3_pDOVJLCGfdivKJPG4I9Q8CZc,435
|
|
61
62
|
type_spec/external/api/chemical/convert_chemical_formats.yaml,sha256=EidTxMCRs-ko5yMFDptJPyAEWYZVruP41OG3cwyBLQQ,1069
|
|
62
63
|
type_spec/external/api/entity/create_entities.yaml,sha256=l24aCHcKD3rnCOIREL3B1th0NXUahSO-thWWBvTEx3Y,1144
|
|
63
64
|
type_spec/external/api/entity/create_entity.yaml,sha256=BjnJC7U_RW063B4E2tg6aXXLpLredrtSHMBNnJobkxE,1339
|
|
@@ -65,6 +66,8 @@ type_spec/external/api/entity/get_entities_data.yaml,sha256=3XujG7bOpuBQlfFrYtG3
|
|
|
65
66
|
type_spec/external/api/entity/list_entities.yaml,sha256=H2YVv6il-XVKd_7IipZqauTDvWCrvHok7z47bDH2sI4,1798
|
|
66
67
|
type_spec/external/api/entity/resolve_entity_ids.yaml,sha256=Zf3OhAohwLJO7wWj0e-sK5lhIsXlD8A5Bu3OGjY4-tA,732
|
|
67
68
|
type_spec/external/api/entity/set_values.yaml,sha256=_UDxSk09Ke0KDABt8ldOScC2CLrbAhBPArZvno5iD4I,422
|
|
69
|
+
type_spec/external/api/id_source/list_id_source.yaml,sha256=BuobTXCJJLp-ogkhkLXluJPQCvUBQ7O2E7Z20Sm1BK8,1020
|
|
70
|
+
type_spec/external/api/id_source/match_id_source.yaml,sha256=j4jDdmElYyY_ZLJQrx66ddy4JYV_9GMWQNi0G8SwY08,837
|
|
68
71
|
type_spec/external/api/input_groups/get_input_group_names.yaml,sha256=LYgnm2Or7ZWCzDGjl53Y1PcHvej8G7Mpp5H96Z4UZCg,913
|
|
69
72
|
type_spec/external/api/inputs/create_inputs.yaml,sha256=pX8jatpve4iJxK7kYw7SBlQXlVHJVfLDCOrDdpn8Gsw,1561
|
|
70
73
|
type_spec/external/api/inputs/get_input_data.yaml,sha256=kjX3VE0y2DxxfUk0J2kjnufSFVAbk_3v28EPuHBhvRE,3825
|
|
@@ -80,17 +83,18 @@ type_spec/external/api/recipe_links/create_recipe_link.yaml,sha256=7b2p7Ei4LnQXq
|
|
|
80
83
|
type_spec/external/api/recipe_metadata/get_recipe_metadata_data.yaml,sha256=mJs82Ci8XSp2ng0W9MKqoeYwIjjgaVYmC5MWFmWFkR8,1759
|
|
81
84
|
type_spec/external/api/recipes/associate_recipe_as_input.yaml,sha256=pX6XCiBlsCiGPHTLW3GP1FkB2NLnLBqZlp6W8hKuym4,486
|
|
82
85
|
type_spec/external/api/recipes/associate_recipe_as_lot.yaml,sha256=8wzeJg5njt4qG2kavA6Jpo9PkWE6rIbuA4IPNdhcwEg,605
|
|
83
|
-
type_spec/external/api/recipes/create_recipe.yaml,sha256=
|
|
86
|
+
type_spec/external/api/recipes/create_recipe.yaml,sha256=kORnb2yaShePpme259kXYkclQ7JLCxMStPZIMHK77CQ,1285
|
|
84
87
|
type_spec/external/api/recipes/create_recipes.yaml,sha256=eXMlXRpB5TFt1mUTECBa4aAIG3KrxYT2mJ5vxmZ9Q3A,1503
|
|
85
88
|
type_spec/external/api/recipes/get_curve.yaml,sha256=QFRFst1EJ6T13G9R07kTiz-wvfxgDKbwHbmjgcvEaNc,568
|
|
86
89
|
type_spec/external/api/recipes/get_recipe_calculations.yaml,sha256=ZE7PzfWrjS7TiO4q7iyCwEj5In8GwO6fFIYGqUlTEXo,1240
|
|
87
90
|
type_spec/external/api/recipes/get_recipe_links.yaml,sha256=Vwm0OVWl3VvDaI7chY_oZQqD8xZ1u09iFWKkZKn1ITo,766
|
|
88
91
|
type_spec/external/api/recipes/get_recipe_names.yaml,sha256=4tqcVj-xLeEu0lhdm8NpLYmAvfkmq08GZ0Mr59I5nLI,896
|
|
89
92
|
type_spec/external/api/recipes/get_recipe_output_metadata.yaml,sha256=YImW94JXVKR6Wz_7R7sRbhD9Ul51Ba-j-x9vJB__AAU,1216
|
|
90
|
-
type_spec/external/api/recipes/get_recipes_data.yaml,sha256=
|
|
91
|
-
type_spec/external/api/recipes/set_recipe_inputs.yaml,sha256=
|
|
93
|
+
type_spec/external/api/recipes/get_recipes_data.yaml,sha256=3Mq0y8cX9SPFkr78Tj-wPf3BUzyd8g9ObOxp9mkkpXE,11283
|
|
94
|
+
type_spec/external/api/recipes/set_recipe_inputs.yaml,sha256=MvnHuzI9JKfkYZb-pC4jeE7FRpGeacJKXd5_GImsDiY,1747
|
|
92
95
|
type_spec/external/api/recipes/set_recipe_metadata.yaml,sha256=XLVwhBSkhbomXYD4AboBEVQt4vBhibvjmWQsDFS10sc,543
|
|
93
96
|
type_spec/external/api/recipes/set_recipe_outputs.yaml,sha256=Oe8XGYXbPNmrbEDXk3qucfS1L3P9TnXI5cxaNAl6x5A,1875
|
|
97
|
+
type_spec/external/api/triggers/run_trigger.yaml,sha256=c8xDV3bQRjcRRDG4Y7kdQmMMu1fj3ae5eUi-Sdbsi54,405
|
|
94
98
|
uncountable/__init__.py,sha256=281cC2hs8pbrD0jVKMol-tbWSh7Zcsc8oRT42dKteyE,102
|
|
95
99
|
uncountable/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
100
|
uncountable/core/__init__.py,sha256=GCXRRhhYv-yKzqKjAij7GcNiOr90BBbgdhhpusWtmUc,100
|
|
@@ -106,17 +110,18 @@ uncountable/integration/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
106
110
|
uncountable/integration/db/connect.py,sha256=iI9e8a2hfbFP-dvH0MGLsrG-RpM0dHKCL-oCLkah9hs,181
|
|
107
111
|
uncountable/integration/executors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
112
|
uncountable/integration/executors/script_executor.py,sha256=6oMPAFe0PUdqt76e8jMi4vXszGVsVHLULob7Qbl3o38,816
|
|
109
|
-
uncountable/types/__init__.py,sha256=
|
|
110
|
-
uncountable/types/async_batch.py,sha256=
|
|
111
|
-
uncountable/types/base.py,sha256=
|
|
113
|
+
uncountable/types/__init__.py,sha256=vN7ogAcLNJbeCkDjr0Y9R_4UAbjonBbDLWo3AZ9L5Mg,5213
|
|
114
|
+
uncountable/types/async_batch.py,sha256=ukbVKXk8j1QMHqiaOpQdVmfwZSPZVmAYjFn4awBItyE,1253
|
|
115
|
+
uncountable/types/base.py,sha256=w3BRf8SAvYPlKrcJtJcQ_WhCU3A9zy0VuRTRWRFKVUA,2709
|
|
112
116
|
uncountable/types/calculations.py,sha256=16J-KKMp-I8ZQUkYNmKCHfAn6DGb99cFinALcDIdGHY,562
|
|
113
117
|
uncountable/types/chemical_structure.py,sha256=zQKl53DGtQQONIUHFXuwjWLQaG7FPZY7x6SBSOzkGV0,758
|
|
114
|
-
uncountable/types/client_base.py,sha256=
|
|
118
|
+
uncountable/types/client_base.py,sha256=lkVyXgLrCfGh5eRc5glYCxamHl4yPqv3WRznOFFbOdQ,41267
|
|
115
119
|
uncountable/types/curves.py,sha256=qYyRntMmFNonEwTrGhquMLbgMqjyP1moQflNTP0FMec,1308
|
|
116
120
|
uncountable/types/entity.py,sha256=NjMZrqBwQ7sZe_oUuJqy9IEG7dWZmFMkQQXJ0_odcnA,11637
|
|
117
121
|
uncountable/types/experiment_groups.py,sha256=ZBEk06F4n98Jz3oEA09WaDmw5rqPs7iVAm_Ysr4gc_o,599
|
|
118
122
|
uncountable/types/field_values.py,sha256=2unBAeBqQPqLQKaL6nGpnDDksZ-5MZepgEF3sgy6oOk,1670
|
|
119
123
|
uncountable/types/fields.py,sha256=eGtZ6axTYGFxLmPAyri2LwlcR4SZ2sX2c6QDX0ybKz0,570
|
|
124
|
+
uncountable/types/id_source.py,sha256=Y3suURq3L1SahZ2oHPD986SU0l3Ik-ZzH38aQKgc1Fg,1341
|
|
120
125
|
uncountable/types/identifier.py,sha256=O_J3sHsG3pFeSIxUKmgIK97FZl6f4qkRDwsNLvY7ymE,1389
|
|
121
126
|
uncountable/types/input_attributes.py,sha256=u-JABoZ-Ij1Ynq5g6MxOgRdQeYbM7OnGP2q_N7KuVdw,826
|
|
122
127
|
uncountable/types/inputs.py,sha256=q7fNGaSKIk3R6uXCEhSQpiHvXu82YcK3oZHDI7bxE88,1597
|
|
@@ -134,6 +139,7 @@ uncountable/types/workflows.py,sha256=JJKM0SeDqAMA2oxwzlG1c1FxeSBI7E49duoITcUrEZ
|
|
|
134
139
|
uncountable/types/api/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
135
140
|
uncountable/types/api/batch/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
136
141
|
uncountable/types/api/batch/execute_batch.py,sha256=cCZo_akwJR4_ET6oOBChdlrCQlxUw8V9i8tDpv7JTIc,1696
|
|
142
|
+
uncountable/types/api/batch/execute_batch_load_async.py,sha256=dcdGFibO8fUDpC__X7Euvgs1EL1nGaNMTjb_QH-06do,885
|
|
137
143
|
uncountable/types/api/chemical/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
138
144
|
uncountable/types/api/chemical/convert_chemical_formats.py,sha256=COGzkfpTL_Ermg2cbasoVKGAxDAtJaTFay18IZtrWCA,1305
|
|
139
145
|
uncountable/types/api/entity/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
@@ -143,6 +149,9 @@ uncountable/types/api/entity/get_entities_data.py,sha256=XjrJGZucIn1TYUlDLRnRA0J
|
|
|
143
149
|
uncountable/types/api/entity/list_entities.py,sha256=_bIIZJj3N0E6YiHgqzfCOKxD1fQW6biWJQMp5wIVbBw,1514
|
|
144
150
|
uncountable/types/api/entity/resolve_entity_ids.py,sha256=AidGpPmI9ATDv0E7vd9LDOl3n3beGxUlRojh5uZrkl4,1086
|
|
145
151
|
uncountable/types/api/entity/set_values.py,sha256=LcYrKQm5ItYLK1Vx7rRq5i6jkMLDhfEBhF0FD1GowQs,958
|
|
152
|
+
uncountable/types/api/id_source/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
153
|
+
uncountable/types/api/id_source/list_id_source.py,sha256=S_NdAd1FIgMtCfpRK9bs4ZIJH7HdyHWImD1qiPuAKMg,1157
|
|
154
|
+
uncountable/types/api/id_source/match_id_source.py,sha256=1Mlw0XGBw7UeWxmwelUEi7Co8Oy15jyhetfKG1BFpIM,1145
|
|
146
155
|
uncountable/types/api/input_groups/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
147
156
|
uncountable/types/api/input_groups/get_input_group_names.py,sha256=LdHWWEfVNGys6Tudienjich56Zz4bj7uXznpyYitCYA,1033
|
|
148
157
|
uncountable/types/api/inputs/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
@@ -165,7 +174,7 @@ uncountable/types/api/recipe_metadata/get_recipe_metadata_data.py,sha256=el6Pn5X
|
|
|
165
174
|
uncountable/types/api/recipes/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
166
175
|
uncountable/types/api/recipes/associate_recipe_as_input.py,sha256=Mo-J2DgwZpbzjS-8pOBvX2VuRfGqnboJXMvFyIzwiPs,880
|
|
167
176
|
uncountable/types/api/recipes/associate_recipe_as_lot.py,sha256=bTYjbnY3B7GKz4MV4UGn7vPjaqMkAfUTio8872d4iws,955
|
|
168
|
-
uncountable/types/api/recipes/create_recipe.py,sha256=
|
|
177
|
+
uncountable/types/api/recipes/create_recipe.py,sha256=L45JexXNo8iUxBI081lz6K1GGLFL3OSo-QPg1EejL-g,1340
|
|
169
178
|
uncountable/types/api/recipes/create_recipes.py,sha256=qwIYa8hfcjY7_VOFt9lxmVtJ-HOJqQN3GDNSbZsRCZU,1544
|
|
170
179
|
uncountable/types/api/recipes/get_curve.py,sha256=lF8MDmBfxm_cIuDxhE80viSFNbcPEkgYkadNFeuI5e4,854
|
|
171
180
|
uncountable/types/api/recipes/get_recipe_calculations.py,sha256=eQmkdZzCEuq8S2f_kf_7GPvDLX1pTnY1CRmkK0SkMCI,1472
|
|
@@ -173,10 +182,12 @@ uncountable/types/api/recipes/get_recipe_links.py,sha256=hk5dfQjv7yU2r-S9b8vwWEJ
|
|
|
173
182
|
uncountable/types/api/recipes/get_recipe_names.py,sha256=uCpXZq5oWjr9a_Vf-yYPaVS72XOlLHgAlju6KHeQ3UA,986
|
|
174
183
|
uncountable/types/api/recipes/get_recipe_output_metadata.py,sha256=L9s2ykPP4pd02Pc98LDisY8bgV8CToS6t6fXKTWqGRw,1464
|
|
175
184
|
uncountable/types/api/recipes/get_recipes_data.py,sha256=dOKokz6rJp3AiqNrF8rAZFlmJSs3ejdNIJhwKw0Utr0,5317
|
|
176
|
-
uncountable/types/api/recipes/set_recipe_inputs.py,sha256=
|
|
185
|
+
uncountable/types/api/recipes/set_recipe_inputs.py,sha256=lFVfv-o_O5wHuMZdH63qlG4exFTlJM078oSAtb3XNxA,1426
|
|
177
186
|
uncountable/types/api/recipes/set_recipe_metadata.py,sha256=Ba6ttd1JuS_Ypt-KpckSviWtOcQ-OTdTEJiaSYyoQL8,933
|
|
178
187
|
uncountable/types/api/recipes/set_recipe_outputs.py,sha256=QYq39TNchQ80ET1C77OE9fwhbu_HmIoEDmrQJHkkCu0,1609
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
UncountablePythonSDK-0.0.
|
|
182
|
-
UncountablePythonSDK-0.0.
|
|
188
|
+
uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
189
|
+
uncountable/types/api/triggers/run_trigger.py,sha256=9m9M8-nlGB_sAU2Qm2lWugp4h4Osqj6QpjNfU8osd1U,901
|
|
190
|
+
UncountablePythonSDK-0.0.19.dist-info/METADATA,sha256=tvcmsrx7qdYmDHTH281xU1Cb88KvCI-0oSs0xIc-bTg,1545
|
|
191
|
+
UncountablePythonSDK-0.0.19.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
192
|
+
UncountablePythonSDK-0.0.19.dist-info/top_level.txt,sha256=HaMiBnH1wA7SG9-RVHIJPBH3l8X5gee2jUf-77Nz-Dk,41
|
|
193
|
+
UncountablePythonSDK-0.0.19.dist-info/RECORD,,
|
pkgs/argument_parser/_is_enum.py
CHANGED
|
@@ -18,7 +18,7 @@ from .case_convert import camel_to_snake_case, snake_to_camel_case
|
|
|
18
18
|
|
|
19
19
|
T = typing.TypeVar("T")
|
|
20
20
|
ParserFunction = typing.Callable[[typing.Any], T]
|
|
21
|
-
ParserCache = dict[
|
|
21
|
+
ParserCache = dict[type[typing.Any], ParserFunction[typing.Any]]
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
@dataclass(frozen=True, eq=True)
|
|
@@ -47,7 +47,7 @@ def is_missing(field_type: typing.Any) -> bool:
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
def _invoke_tuple_parsers(
|
|
50
|
-
tuple_type:
|
|
50
|
+
tuple_type: type[T],
|
|
51
51
|
arg_parsers: typing.Sequence[typing.Callable[[typing.Any], object]],
|
|
52
52
|
has_ellipsis: bool,
|
|
53
53
|
value: typing.Any,
|
|
@@ -66,7 +66,7 @@ def _invoke_tuple_parsers(
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
def _invoke_fallback_parsers(
|
|
69
|
-
original_type:
|
|
69
|
+
original_type: type[T],
|
|
70
70
|
arg_parsers: typing.Sequence[typing.Callable[[typing.Any], T]],
|
|
71
71
|
value: typing.Any,
|
|
72
72
|
) -> T:
|
|
@@ -84,7 +84,7 @@ def _invoke_fallback_parsers(
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
def _invoke_membership_parser(
|
|
87
|
-
expected_values:
|
|
87
|
+
expected_values: set[T],
|
|
88
88
|
value: typing.Any,
|
|
89
89
|
) -> T:
|
|
90
90
|
"""
|
|
@@ -99,7 +99,7 @@ def _invoke_membership_parser(
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
def _build_parser_inner(
|
|
102
|
-
parsed_type:
|
|
102
|
+
parsed_type: type[T],
|
|
103
103
|
context: ParserContext,
|
|
104
104
|
*,
|
|
105
105
|
convert_string_to_snake_case: bool = False,
|
|
@@ -143,7 +143,7 @@ def _build_parser_inner(
|
|
|
143
143
|
origin = typing.get_origin(parsed_type)
|
|
144
144
|
if origin is tuple:
|
|
145
145
|
args = typing.get_args(parsed_type)
|
|
146
|
-
element_parsers:
|
|
146
|
+
element_parsers: list[typing.Callable[[typing.Any], object]] = []
|
|
147
147
|
has_ellipsis = False
|
|
148
148
|
for arg in args:
|
|
149
149
|
assert not has_ellipsis
|
|
@@ -200,7 +200,7 @@ def _build_parser_inner(
|
|
|
200
200
|
return lambda value: origin((k_parser(k), v_parser(v)) for k, v in value.items())
|
|
201
201
|
|
|
202
202
|
if origin == typing.Literal:
|
|
203
|
-
valid_values:
|
|
203
|
+
valid_values: set[T] = set(typing.get_args(parsed_type))
|
|
204
204
|
return lambda value: _invoke_membership_parser(valid_values, value)
|
|
205
205
|
|
|
206
206
|
if parsed_type is str and convert_string_to_snake_case:
|
|
@@ -257,7 +257,7 @@ def _build_parser_inner(
|
|
|
257
257
|
|
|
258
258
|
|
|
259
259
|
def _build_parser_dataclass(
|
|
260
|
-
parsed_type:
|
|
260
|
+
parsed_type: type[T],
|
|
261
261
|
context: ParserContext,
|
|
262
262
|
) -> ParserFunction[T]:
|
|
263
263
|
"""
|
|
@@ -271,9 +271,9 @@ def _build_parser_dataclass(
|
|
|
271
271
|
|
|
272
272
|
type_hints = typing.get_type_hints(parsed_type)
|
|
273
273
|
dc_field_parsers: list[
|
|
274
|
-
|
|
274
|
+
tuple[
|
|
275
275
|
dataclasses.Field[typing.Any],
|
|
276
|
-
|
|
276
|
+
type[typing.Any],
|
|
277
277
|
ParserFunction[typing.Any],
|
|
278
278
|
]
|
|
279
279
|
] = []
|
|
@@ -281,7 +281,7 @@ def _build_parser_dataclass(
|
|
|
281
281
|
serial_class_data = get_serial_class_data(parsed_type)
|
|
282
282
|
|
|
283
283
|
def parse(value: typing.Any) -> typing.Any:
|
|
284
|
-
data:
|
|
284
|
+
data: dict[typing.Any, typing.Any] = {}
|
|
285
285
|
for field, field_type, field_parser in dc_field_parsers:
|
|
286
286
|
field_raw_value = None
|
|
287
287
|
try:
|
|
@@ -347,7 +347,7 @@ _CACHE_MAP: dict[ParserOptions, ParserCache] = defaultdict(ParserCache)
|
|
|
347
347
|
|
|
348
348
|
|
|
349
349
|
def build_parser(
|
|
350
|
-
parsed_type:
|
|
350
|
+
parsed_type: type[T],
|
|
351
351
|
options: ParserOptions,
|
|
352
352
|
) -> ParserFunction[T]:
|
|
353
353
|
"""
|
|
@@ -371,7 +371,7 @@ def build_parser(
|
|
|
371
371
|
class CachedParser(typing.Generic[T]):
|
|
372
372
|
def __init__(
|
|
373
373
|
self,
|
|
374
|
-
args:
|
|
374
|
+
args: type[T],
|
|
375
375
|
):
|
|
376
376
|
self.arguments = args
|
|
377
377
|
self.parser_api: typing.Optional[ParserFunction[T]] = None
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import dataclasses
|
|
4
|
-
from
|
|
5
|
-
|
|
6
|
-
from
|
|
4
|
+
from collections.abc import Callable
|
|
5
|
+
from enum import StrEnum
|
|
6
|
+
from typing import Any, Optional, TypeVar, cast
|
|
7
7
|
|
|
8
8
|
_ClassT = TypeVar("_ClassT")
|
|
9
9
|
|
|
@@ -64,13 +64,14 @@ def main() -> None:
|
|
|
64
64
|
action_definitions: defaultdict[str, list[actions_registry_t.ActionDefinition]] = (
|
|
65
65
|
defaultdict(list)
|
|
66
66
|
)
|
|
67
|
+
all_action_definitions: list[actions_registry_t.ActionDefinition] = []
|
|
68
|
+
|
|
67
69
|
for file_info in files_info:
|
|
68
70
|
in_action_definitions = action_definition_parser.parse_yaml_file(
|
|
69
71
|
file_info.filepath
|
|
70
72
|
)
|
|
71
73
|
if len(in_action_definitions) == 0:
|
|
72
74
|
continue
|
|
73
|
-
|
|
74
75
|
for ref_name, definition in in_action_definitions.items():
|
|
75
76
|
modules = [*file_info.directories]
|
|
76
77
|
# if the actions are stored in index.yaml, parent dir should be treated as module
|
|
@@ -78,7 +79,7 @@ def main() -> None:
|
|
|
78
79
|
modules.append(file_info.filename)
|
|
79
80
|
|
|
80
81
|
module_str = "_".join(modules)
|
|
81
|
-
|
|
82
|
+
all_action_definitions.append(
|
|
82
83
|
actions_registry_t.ActionDefinition(
|
|
83
84
|
name=definition.name,
|
|
84
85
|
short_description=definition.short_description,
|
|
@@ -96,12 +97,17 @@ def main() -> None:
|
|
|
96
97
|
else None,
|
|
97
98
|
)
|
|
98
99
|
)
|
|
99
|
-
|
|
100
|
+
all_action_definitions = sorted(
|
|
101
|
+
all_action_definitions, key=lambda item: (item.module, item.ref_name)
|
|
102
|
+
)
|
|
103
|
+
for action_definition in all_action_definitions:
|
|
104
|
+
action_definitions[action_definition.module].append(action_definition)
|
|
100
105
|
ts_content = emit_action_definitions(action_definitions)
|
|
101
106
|
rewrite_file(
|
|
102
107
|
"main/site/js/materials/base/actions_registry/action_definitions.tsx",
|
|
103
108
|
ts_content,
|
|
104
109
|
)
|
|
110
|
+
|
|
105
111
|
sys.exit(0)
|
|
106
112
|
|
|
107
113
|
|
|
@@ -12,8 +12,16 @@ def _action_symbol_name(action_definition: actions_registry_t.ActionDefinition)
|
|
|
12
12
|
return f"{ts_name(action_definition.ref_name, name_case=builder.NameCase.convert)}"
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
def _action_module_name_base(module: str) -> str:
|
|
16
|
+
return f"{ts_name(module, name_case=builder.NameCase.convert)}"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _action_module_name_obj(module: str) -> str:
|
|
20
|
+
return f"{_action_module_name_base(module)}Actions"
|
|
21
|
+
|
|
22
|
+
|
|
15
23
|
def _action_module_name(module: str) -> str:
|
|
16
|
-
return f"ActionsRegistryT.ActionsRegistryModule.{
|
|
24
|
+
return f"ActionsRegistryT.ActionsRegistryModule.{_action_module_name_base(module)}"
|
|
17
25
|
|
|
18
26
|
|
|
19
27
|
def emit_action_definitions(
|
|
@@ -24,19 +32,25 @@ def emit_action_definitions(
|
|
|
24
32
|
out.write("\n")
|
|
25
33
|
out.write('import { ActionsRegistryT } from "unc_mat/types"\n\n')
|
|
26
34
|
out.write(MODIFY_NOTICE)
|
|
27
|
-
out.write("export const actionDefinitions = {\n")
|
|
28
35
|
modules = []
|
|
29
36
|
for key, values in action_definitions.items():
|
|
30
37
|
out.write(MODIFY_NOTICE)
|
|
31
|
-
out.write(f"{INDENT}[{_action_module_name(key)}]: {{\n")
|
|
32
38
|
modules.append(key)
|
|
39
|
+
out.write(f"export const {_action_module_name_obj(key)} = {{\n")
|
|
33
40
|
for action_definition in values:
|
|
34
|
-
out.write(
|
|
35
|
-
|
|
41
|
+
out.write(MODIFY_NOTICE)
|
|
42
|
+
out.write(_emit_action_definition(action_definition, INDENT))
|
|
43
|
+
out.write("}\n")
|
|
36
44
|
|
|
37
|
-
out.write("}\n")
|
|
38
45
|
out.write(MODIFY_NOTICE)
|
|
39
46
|
out.write("\n")
|
|
47
|
+
out.write("export const actionDefinitions = {\n")
|
|
48
|
+
for module in modules:
|
|
49
|
+
out.write(
|
|
50
|
+
f"{INDENT}[{_action_module_name(module)}]: {_action_module_name_obj(module)},\n"
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
out.write("}\n")
|
|
40
54
|
out.write(_emit_action_definition_types(modules, indent=""))
|
|
41
55
|
out.write(MODIFY_NOTICE)
|
|
42
56
|
out.write("\n")
|
pkgs/type_spec/builder.py
CHANGED
|
@@ -9,22 +9,22 @@ import os
|
|
|
9
9
|
import re
|
|
10
10
|
from collections import defaultdict
|
|
11
11
|
from dataclasses import MISSING, dataclass
|
|
12
|
-
from enum import Enum, auto
|
|
13
|
-
from typing import Any,
|
|
12
|
+
from enum import Enum, StrEnum, auto
|
|
13
|
+
from typing import Any, Optional
|
|
14
14
|
|
|
15
15
|
from . import util
|
|
16
16
|
from .util import parse_type_str, unused
|
|
17
17
|
|
|
18
|
-
RawDict =
|
|
18
|
+
RawDict = dict[Any, Any]
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
class PropertyExtant(
|
|
21
|
+
class PropertyExtant(StrEnum):
|
|
22
22
|
required = "required"
|
|
23
23
|
optional = "optional"
|
|
24
24
|
missing = "missing"
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
class PropertyConvertValue(
|
|
27
|
+
class PropertyConvertValue(StrEnum):
|
|
28
28
|
# Base conversion on underlying types
|
|
29
29
|
auto = "auto"
|
|
30
30
|
# Always convert the value (Not needed yet, thus not supported)
|
|
@@ -52,7 +52,7 @@ class SpecProperty:
|
|
|
52
52
|
ext_info: Any = None
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
class NameCase(
|
|
55
|
+
class NameCase(StrEnum):
|
|
56
56
|
convert = "convert"
|
|
57
57
|
preserve = "preserve"
|
|
58
58
|
# Upper-case in JavaScript, convert otherwise. This is a compatibilty
|
|
@@ -60,7 +60,7 @@ class NameCase(str, Enum):
|
|
|
60
60
|
js_upper = "js_upper"
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
class BaseTypeName(
|
|
63
|
+
class BaseTypeName(StrEnum):
|
|
64
64
|
"""
|
|
65
65
|
Base types that are supported.
|
|
66
66
|
"""
|
|
@@ -92,7 +92,7 @@ class BaseTypeName(str, Enum):
|
|
|
92
92
|
s_object = "Object"
|
|
93
93
|
|
|
94
94
|
|
|
95
|
-
class DefnTypeName(
|
|
95
|
+
class DefnTypeName(StrEnum):
|
|
96
96
|
# Type is a named alias of another type
|
|
97
97
|
s_alias = "Alias"
|
|
98
98
|
# Type is imported from an external source (opaque to type_spec)
|
|
@@ -656,7 +656,7 @@ TOKEN_EMIT_TYPE_INFO = "$emit_type_info"
|
|
|
656
656
|
TOKEN_IMPORT = "$import"
|
|
657
657
|
|
|
658
658
|
|
|
659
|
-
class RouteMethod(
|
|
659
|
+
class RouteMethod(StrEnum):
|
|
660
660
|
post = "post"
|
|
661
661
|
get = "get"
|
|
662
662
|
delete = "delete"
|
|
@@ -664,7 +664,7 @@ class RouteMethod(str, Enum):
|
|
|
664
664
|
put = "put"
|
|
665
665
|
|
|
666
666
|
|
|
667
|
-
class ResultType(
|
|
667
|
+
class ResultType(StrEnum):
|
|
668
668
|
json = "json"
|
|
669
669
|
binary = "binary"
|
|
670
670
|
|
pkgs/type_spec/config.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import os
|
|
2
|
+
from collections.abc import Callable, Mapping
|
|
2
3
|
from dataclasses import dataclass
|
|
3
4
|
from decimal import Decimal
|
|
4
|
-
from typing import
|
|
5
|
+
from typing import Self, TypeVar
|
|
5
6
|
|
|
6
7
|
import yaml
|
|
7
8
|
|
|
@@ -96,7 +97,7 @@ class Config:
|
|
|
96
97
|
_T = TypeVar("_T")
|
|
97
98
|
|
|
98
99
|
|
|
99
|
-
def _parse_language(config_class:
|
|
100
|
+
def _parse_language(config_class: type[_T], raw_value: ConfigValueType) -> _T:
|
|
100
101
|
assert isinstance(raw_value, dict), "expecting language config to have key/values."
|
|
101
102
|
return config_class(**raw_value)
|
|
102
103
|
|
pkgs/type_spec/emit_python.py
CHANGED
|
@@ -2,7 +2,7 @@ import io
|
|
|
2
2
|
import os
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
4
|
from decimal import Decimal
|
|
5
|
-
from typing import Any, Optional
|
|
5
|
+
from typing import Any, Optional
|
|
6
6
|
|
|
7
7
|
from . import builder, util
|
|
8
8
|
from .config import PythonConfig
|
|
@@ -25,8 +25,8 @@ END_ALL_EXPORTS = "]\n"
|
|
|
25
25
|
@dataclass(kw_only=True)
|
|
26
26
|
class TrackingContext:
|
|
27
27
|
namespace: Optional[builder.SpecNamespace] = None
|
|
28
|
-
namespaces:
|
|
29
|
-
names:
|
|
28
|
+
namespaces: set[builder.SpecNamespace] = field(default_factory=set)
|
|
29
|
+
names: set[str] = field(default_factory=set)
|
|
30
30
|
|
|
31
31
|
use_enum: bool = False
|
|
32
32
|
use_serial_string_enum: bool = False
|
|
@@ -119,6 +119,9 @@ def _emit_value(ctx: TrackingContext, stype: builder.SpecType, value: Any) -> st
|
|
|
119
119
|
# Note that decimal requires the `!decimal 123.12` style notation in the YAML
|
|
120
120
|
# file since PyYaml parses numbers as float, unfortuantely
|
|
121
121
|
assert isinstance(value, (Decimal, int))
|
|
122
|
+
if isinstance(value, int):
|
|
123
|
+
# skip quotes for integers
|
|
124
|
+
return f"Decimal({value})"
|
|
122
125
|
return f'Decimal("{value}")'
|
|
123
126
|
elif isinstance(stype, builder.SpecTypeInstance):
|
|
124
127
|
if stype.defn_type.is_base_type(builder.BaseTypeName.s_list):
|
|
@@ -220,7 +223,7 @@ def _emit_types(*, builder: builder.SpecBuilder, config: PythonConfig) -> None:
|
|
|
220
223
|
exports_out = io.StringIO()
|
|
221
224
|
exports_out.write(START_ALL_EXPORTS)
|
|
222
225
|
|
|
223
|
-
all_dirs:
|
|
226
|
+
all_dirs: set[str] = set()
|
|
224
227
|
|
|
225
228
|
for namespace in sorted(
|
|
226
229
|
builder.namespaces.values(),
|
|
@@ -500,10 +503,10 @@ def _emit_string_enum(ctx: Context, stype: builder.SpecTypeDefnStringEnum) -> No
|
|
|
500
503
|
|
|
501
504
|
@dataclass
|
|
502
505
|
class EmittedPropertiesMetadata:
|
|
503
|
-
unconverted_keys:
|
|
504
|
-
unconverted_values:
|
|
505
|
-
to_string_values:
|
|
506
|
-
parse_require:
|
|
506
|
+
unconverted_keys: set[str]
|
|
507
|
+
unconverted_values: set[str]
|
|
508
|
+
to_string_values: set[str]
|
|
509
|
+
parse_require: set[str]
|
|
507
510
|
|
|
508
511
|
|
|
509
512
|
def _emit_type_properties(
|
|
@@ -514,10 +517,10 @@ def _emit_type_properties(
|
|
|
514
517
|
num_indent: int = 1,
|
|
515
518
|
separator: str = "\n",
|
|
516
519
|
) -> EmittedPropertiesMetadata:
|
|
517
|
-
unconverted_keys:
|
|
518
|
-
unconverted_values:
|
|
519
|
-
to_string_values:
|
|
520
|
-
parse_require:
|
|
520
|
+
unconverted_keys: set[str] = set()
|
|
521
|
+
unconverted_values: set[str] = set()
|
|
522
|
+
to_string_values: set[str] = set()
|
|
523
|
+
parse_require: set[str] = set()
|
|
521
524
|
|
|
522
525
|
if stype.properties is not None and len(stype.properties) > 0:
|
|
523
526
|
|
|
@@ -811,7 +814,7 @@ ROUTES: list[DynamicRouteType] = [
|
|
|
811
814
|
def _emit_namespace_imports(
|
|
812
815
|
*,
|
|
813
816
|
out: io.StringIO,
|
|
814
|
-
namespaces:
|
|
817
|
+
namespaces: set[builder.SpecNamespace],
|
|
815
818
|
from_namespace: Optional[builder.SpecNamespace],
|
|
816
819
|
config: PythonConfig,
|
|
817
820
|
) -> None:
|
|
@@ -844,7 +847,7 @@ def _emit_id_source(*, builder: builder.SpecBuilder, config: PythonConfig) -> No
|
|
|
844
847
|
return None
|
|
845
848
|
enum_out = io.StringIO()
|
|
846
849
|
enum_out.write(f"{LINT_HEADER}{MODIFY_NOTICE}\n")
|
|
847
|
-
enum_out.write("from typing import Literal,
|
|
850
|
+
enum_out.write("from typing import Literal, Union\n")
|
|
848
851
|
enum_out.write("from pkgs.strenum_compat import StrEnum\n")
|
|
849
852
|
|
|
850
853
|
ctx = TrackingContext()
|
|
@@ -859,13 +862,13 @@ def _emit_id_source(*, builder: builder.SpecBuilder, config: PythonConfig) -> No
|
|
|
859
862
|
)
|
|
860
863
|
|
|
861
864
|
known_keys = []
|
|
862
|
-
enum_out.write("\nENUM_MAP: dict[str,
|
|
865
|
+
enum_out.write("\nENUM_MAP: dict[str, type[StrEnum]] = {\n")
|
|
863
866
|
for key in sorted(named_enums.keys()):
|
|
864
867
|
enum_out.write(f'"{key}": {named_enums[key]},\n')
|
|
865
868
|
known_keys.append(f'Literal["{key}"]')
|
|
866
869
|
enum_out.write(f"}}\n{MODIFY_NOTICE}\n")
|
|
867
870
|
|
|
868
|
-
enum_out.write(f"\nKnownEnumsType = Union[
|
|
871
|
+
enum_out.write(f"\nKnownEnumsType = Union[\n{INDENT}")
|
|
869
872
|
enum_out.write(f",\n{INDENT}".join(known_keys))
|
|
870
873
|
enum_out.write(f"\n]\n{MODIFY_NOTICE}\n")
|
|
871
874
|
|