hcs-core 0.1.319__tar.gz → 0.1.321__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.
Files changed (71) hide show
  1. {hcs_core-0.1.319 → hcs_core-0.1.321}/PKG-INFO +1 -1
  2. hcs_core-0.1.321/hcs_core/__init__.py +1 -0
  3. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/_init.py +4 -19
  4. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/util.py +23 -5
  5. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/core.py +4 -2
  6. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/ez_client.py +1 -1
  7. hcs_core-0.1.319/hcs_core/__init__.py +0 -1
  8. {hcs_core-0.1.319 → hcs_core-0.1.321}/.gitignore +0 -0
  9. {hcs_core-0.1.319 → hcs_core-0.1.321}/README.md +0 -0
  10. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/__init__.py +0 -0
  11. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/built_in_cmds/__init__.py +0 -0
  12. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/built_in_cmds/_ut.py +0 -0
  13. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/built_in_cmds/context.py +0 -0
  14. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/built_in_cmds/profile.py +0 -0
  15. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/cli_options.py +0 -0
  16. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/cli_processor.py +0 -0
  17. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/cmd_util.py +0 -0
  18. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/config.py +0 -0
  19. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/context.py +0 -0
  20. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/data_util.py +0 -0
  21. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/dispatcher.py +0 -0
  22. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/duration.py +0 -0
  23. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/extension.py +0 -0
  24. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/fn_util.py +0 -0
  25. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/fstore.py +0 -0
  26. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/jsondot.py +0 -0
  27. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/logger.py +0 -0
  28. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/profile.py +0 -0
  29. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/profile_store.py +0 -0
  30. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/recent.py +0 -0
  31. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/state.py +0 -0
  32. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/task_schd.py +0 -0
  33. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/telemetry.py +0 -0
  34. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/template_util.py +0 -0
  35. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/timeutil.py +0 -0
  36. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/ctxp/var_template.py +0 -0
  37. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/__init__.py +0 -0
  38. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/actions.py +0 -0
  39. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/base_provider.py +0 -0
  40. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/context.py +0 -0
  41. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/dag.py +0 -0
  42. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/helper.py +0 -0
  43. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/kop.py +0 -0
  44. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/provider/__init__.py +0 -0
  45. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/provider/dev/__init__.py +0 -0
  46. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/provider/dev/_prepare.py +0 -0
  47. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/provider/dev/dummy.py +0 -0
  48. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/plan/provider/dev/fibonacci.py +0 -0
  49. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/__init__.py +0 -0
  50. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/auth.py +0 -0
  51. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/cli_options.py +0 -0
  52. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/client_util.py +0 -0
  53. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/csp.py +0 -0
  54. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/hcs_client.py +0 -0
  55. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/init.py +0 -0
  56. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/login_support.py +0 -0
  57. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/payload_util.py +0 -0
  58. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/requtil.py +0 -0
  59. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/sglib/utils.py +0 -0
  60. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/__init__.py +0 -0
  61. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/check_license.py +0 -0
  62. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/duration.py +0 -0
  63. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/exit.py +0 -0
  64. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/hcs_constants.py +0 -0
  65. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/job_view.py +0 -0
  66. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/pki_util.py +0 -0
  67. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/query_util.py +0 -0
  68. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/scheduler.py +0 -0
  69. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/ssl_util.py +0 -0
  70. {hcs_core-0.1.319 → hcs_core-0.1.321}/hcs_core/util/versions.py +0 -0
  71. {hcs_core-0.1.319 → hcs_core-0.1.321}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcs-core
3
- Version: 0.1.319
3
+ Version: 0.1.321
4
4
  Summary: Horizon Cloud Service CLI module.
5
5
  Project-URL: Homepage, https://github.com/euc-eng/hcs-cli
6
6
  Project-URL: Bug Tracker, https://github.com/euc-eng/hcs-cli/issues
@@ -0,0 +1 @@
1
+ __version__ = "0.1.321"
@@ -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 _need_stack_trace(e):
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
- if _need_stack_trace(e):
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
- critical_errors = [KeyError, TypeError, AttributeError, ValueError, IndentationError, ImportError]
133
- for ex in critical_errors:
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
- kop.start(KOP.MODE.create, handler.eta("create", res_data, state))
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
- kop.start(KOP.MODE.create, handler.eta(actions.create, res_data, res_state))
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):
@@ -229,7 +229,7 @@ class EzClient:
229
229
 
230
230
  def get(self, url: str, headers: dict = None, raise_on_404: bool = False, type: Optional[Type[BaseModel]] = None):
231
231
  try:
232
- # print("->", self._client().base_url, url)
232
+ # print("->", str(self._client().base_url) + url)
233
233
  resp = self._client().get(url, headers=headers, follow_redirects=True)
234
234
  data = _parse_resp(resp)
235
235
  if data and type:
@@ -1 +0,0 @@
1
- __version__ = "0.1.319"
File without changes
File without changes
File without changes