hcs-core 0.1.319__tar.gz → 0.1.320__tar.gz
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.
- {hcs_core-0.1.319 → hcs_core-0.1.320}/PKG-INFO +1 -1
- hcs_core-0.1.320/hcs_core/__init__.py +1 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/_init.py +4 -19
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/util.py +23 -5
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/core.py +4 -2
- hcs_core-0.1.319/hcs_core/__init__.py +0 -1
- {hcs_core-0.1.319 → hcs_core-0.1.320}/.gitignore +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/README.md +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/__init__.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/built_in_cmds/__init__.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/built_in_cmds/_ut.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/built_in_cmds/context.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/built_in_cmds/profile.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/cli_options.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/cli_processor.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/cmd_util.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/config.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/context.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/data_util.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/dispatcher.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/duration.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/extension.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/fn_util.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/fstore.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/jsondot.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/logger.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/profile.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/profile_store.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/recent.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/state.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/task_schd.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/telemetry.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/template_util.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/timeutil.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/ctxp/var_template.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/__init__.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/actions.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/base_provider.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/context.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/dag.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/helper.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/kop.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/provider/__init__.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/provider/dev/__init__.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/provider/dev/_prepare.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/provider/dev/dummy.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/plan/provider/dev/fibonacci.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/__init__.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/auth.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/cli_options.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/client_util.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/csp.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/ez_client.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/hcs_client.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/init.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/login_support.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/payload_util.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/requtil.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/sglib/utils.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/__init__.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/check_license.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/duration.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/exit.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/hcs_constants.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/job_view.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/pki_util.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/query_util.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/scheduler.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/ssl_util.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/hcs_core/util/versions.py +0 -0
- {hcs_core-0.1.319 → hcs_core-0.1.320}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.320"
|
|
@@ -20,6 +20,7 @@ from pathlib import Path
|
|
|
20
20
|
import click
|
|
21
21
|
|
|
22
22
|
from . import cli_processor, config, profile, state, telemetry
|
|
23
|
+
from .util import is_program_error
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
def _get_store_path():
|
|
@@ -55,7 +56,7 @@ def init(app_name: str, store_path: str = user_home, config_path: str = "./confi
|
|
|
55
56
|
|
|
56
57
|
except Exception as e:
|
|
57
58
|
# critical errors, must print stack trace.
|
|
58
|
-
if
|
|
59
|
+
if is_program_error(e):
|
|
59
60
|
raise e
|
|
60
61
|
else:
|
|
61
62
|
# Other errors, no stack.
|
|
@@ -86,26 +87,10 @@ def init_cli(main_cli: click.Group, commands_dir: str = "./cmds"):
|
|
|
86
87
|
return ret
|
|
87
88
|
except BaseException as e:
|
|
88
89
|
telemetry.end(error=e)
|
|
89
|
-
|
|
90
|
+
|
|
91
|
+
if is_program_error(e):
|
|
90
92
|
raise e
|
|
91
93
|
else:
|
|
92
94
|
from .util import panic
|
|
93
95
|
|
|
94
96
|
panic(e)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
def _need_stack_trace(e) -> bool:
|
|
98
|
-
program_errors = [
|
|
99
|
-
LookupError,
|
|
100
|
-
TypeError,
|
|
101
|
-
ValueError,
|
|
102
|
-
ArithmeticError,
|
|
103
|
-
NameError,
|
|
104
|
-
SyntaxError,
|
|
105
|
-
KeyError,
|
|
106
|
-
AttributeError,
|
|
107
|
-
]
|
|
108
|
-
for t in program_errors:
|
|
109
|
-
if isinstance(e, t):
|
|
110
|
-
return True
|
|
111
|
-
return False
|
|
@@ -128,12 +128,30 @@ def print_output(data: Any, args: dict, file=sys.stdout):
|
|
|
128
128
|
print(text, end="", file=file, flush=True)
|
|
129
129
|
|
|
130
130
|
|
|
131
|
+
def is_program_error(e: Exception) -> bool:
|
|
132
|
+
program_errors = [
|
|
133
|
+
ArithmeticError,
|
|
134
|
+
IndexError,
|
|
135
|
+
NameError,
|
|
136
|
+
SyntaxError,
|
|
137
|
+
LookupError,
|
|
138
|
+
KeyError,
|
|
139
|
+
TypeError,
|
|
140
|
+
AttributeError,
|
|
141
|
+
ValueError,
|
|
142
|
+
IndentationError,
|
|
143
|
+
ImportError,
|
|
144
|
+
AssertionError,
|
|
145
|
+
]
|
|
146
|
+
for ex in program_errors:
|
|
147
|
+
if isinstance(e, ex):
|
|
148
|
+
return True
|
|
149
|
+
return False
|
|
150
|
+
|
|
151
|
+
|
|
131
152
|
def print_error(error):
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if isinstance(error, ex):
|
|
135
|
-
traceback.print_exception(type(error), error, error.__traceback__, file=sys.stderr)
|
|
136
|
-
break
|
|
153
|
+
if is_program_error(error):
|
|
154
|
+
traceback.print_exception(type(error), error, error.__traceback__, file=sys.stderr)
|
|
137
155
|
msg = error_details(error)
|
|
138
156
|
print(msg, file=sys.stderr, flush=True)
|
|
139
157
|
|
|
@@ -242,7 +242,8 @@ def _get_res_text(handler, res_state: dict) -> str:
|
|
|
242
242
|
def _deploy_res(name, res, state):
|
|
243
243
|
def fn_deploy1(handler, res_data: dict, res_state: dict, fn_set_state: typing.Callable, kop: KOP):
|
|
244
244
|
if _is_runtime(res):
|
|
245
|
-
|
|
245
|
+
eta = res.get("eta") or handler.eta(actions.create, res_data, state)
|
|
246
|
+
kop.start(KOP.MODE.create, eta)
|
|
246
247
|
new_state = handler.process(res_data, deepcopy(state))
|
|
247
248
|
if new_state:
|
|
248
249
|
fn_set_state(new_state)
|
|
@@ -266,7 +267,8 @@ def _deploy_res(name, res, state):
|
|
|
266
267
|
|
|
267
268
|
new_state = None
|
|
268
269
|
if action == actions.create or action is None:
|
|
269
|
-
|
|
270
|
+
eta = res.get("eta") or handler.eta(actions.create, res_data, state)
|
|
271
|
+
kop.start(KOP.MODE.create, eta)
|
|
270
272
|
if _has_save_state(handler.deploy):
|
|
271
273
|
|
|
272
274
|
def _hook_set_state(data):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.319"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|