yellowdog-python-examples 8.4.2__tar.gz → 8.4.3__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 (81) hide show
  1. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/PKG-INFO +1 -1
  2. yellowdog_python_examples-8.4.3/yellowdog_cli/__init__.py +1 -0
  3. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/show.py +17 -17
  4. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/args.py +4 -14
  5. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/variables.py +7 -0
  6. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_python_examples.egg-info/PKG-INFO +1 -1
  7. yellowdog_python_examples-8.4.2/yellowdog_cli/__init__.py +0 -1
  8. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/LICENSE +0 -0
  9. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/PYPI_README.md +0 -0
  10. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/README.md +0 -0
  11. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/pyproject.toml +0 -0
  12. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/requirements.txt +0 -0
  13. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/setup.cfg +0 -0
  14. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/tests/test_create_remove.py +0 -0
  15. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/tests/test_demos.py +0 -0
  16. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/tests/test_dryruns.py +0 -0
  17. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/tests/test_entrypoints.py +0 -0
  18. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/tests/test_gui.py +0 -0
  19. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/tests/test_list.py +0 -0
  20. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/tests/test_objects.py +0 -0
  21. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/tests/test_variable_processing.py +0 -0
  22. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/abort.py +0 -0
  23. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/admin.py +0 -0
  24. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/application.py +0 -0
  25. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/boost.py +0 -0
  26. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/cancel.py +0 -0
  27. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/cloudwizard.py +0 -0
  28. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/compare.py +0 -0
  29. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/create.py +0 -0
  30. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/delete.py +0 -0
  31. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/download.py +0 -0
  32. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/finish.py +0 -0
  33. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/follow.py +0 -0
  34. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/format_json.py +0 -0
  35. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/hold.py +0 -0
  36. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/instantiate.py +0 -0
  37. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/jsonnet2json.py +0 -0
  38. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/list.py +0 -0
  39. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/provision.py +0 -0
  40. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/remove.py +0 -0
  41. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/resize.py +0 -0
  42. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/shutdown.py +0 -0
  43. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/start.py +0 -0
  44. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/submit.py +0 -0
  45. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/terminate.py +0 -0
  46. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/upload.py +0 -0
  47. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/__init__.py +0 -0
  48. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/check_imports.py +0 -0
  49. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/cloudwizard_aws.py +0 -0
  50. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/cloudwizard_aws_types.py +0 -0
  51. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/cloudwizard_azure.py +0 -0
  52. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/cloudwizard_common.py +0 -0
  53. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/cloudwizard_gcp.py +0 -0
  54. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/compact_json.py +0 -0
  55. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/config_types.py +0 -0
  56. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/csv_data.py +0 -0
  57. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/entity_utils.py +0 -0
  58. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/follow_utils.py +0 -0
  59. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/interactive.py +0 -0
  60. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/items.py +0 -0
  61. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/load_config.py +0 -0
  62. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/load_resources.py +0 -0
  63. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/misc_utils.py +0 -0
  64. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/printing.py +0 -0
  65. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/property_names.py +0 -0
  66. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/provision_utils.py +0 -0
  67. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/rich_console_input_fixed.py +0 -0
  68. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/settings.py +0 -0
  69. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/start_hold_common.py +0 -0
  70. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/submit_utils.py +0 -0
  71. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/type_check.py +0 -0
  72. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/upload_utils.py +0 -0
  73. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/validate_properties.py +0 -0
  74. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/wrapper.py +0 -0
  75. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/utils/ydid_utils.py +0 -0
  76. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_cli/version.py +0 -0
  77. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_python_examples.egg-info/SOURCES.txt +0 -0
  78. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_python_examples.egg-info/dependency_links.txt +0 -0
  79. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_python_examples.egg-info/entry_points.txt +0 -0
  80. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_python_examples.egg-info/requires.txt +0 -0
  81. {yellowdog_python_examples-8.4.2 → yellowdog_python_examples-8.4.3}/yellowdog_python_examples.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yellowdog-python-examples
3
- Version: 8.4.2
3
+ Version: 8.4.3
4
4
  Summary: Python CLI commands using the YellowDog Python SDK
5
5
  Author-email: YellowDog Limited <support@yellowdog.co>
6
6
  License-Expression: Apache-2.0
@@ -0,0 +1 @@
1
+ __version__ = "8.4.3"
@@ -4,6 +4,8 @@
4
4
  Command to show the JSON details of YellowDog entities via their IDs.
5
5
  """
6
6
 
7
+ from typing import List
8
+
7
9
  from yellowdog_client.model import ConfiguredWorkerPool
8
10
 
9
11
  from yellowdog_cli.list import get_keyring
@@ -33,16 +35,16 @@ from yellowdog_cli.utils.settings import (
33
35
  RN_ROLE,
34
36
  RN_SOURCE_TEMPLATE,
35
37
  )
36
- from yellowdog_cli.utils.variables import get_user_variable
37
- from yellowdog_cli.utils.wrapper import ARGS_PARSER, CLIENT, CONFIG_COMMON, main_wrapper
38
+ from yellowdog_cli.utils.variables import get_all_user_variables, get_user_variable
39
+ from yellowdog_cli.utils.wrapper import ARGS_PARSER, CLIENT, main_wrapper
38
40
  from yellowdog_cli.utils.ydid_utils import YDIDType, get_ydid_type
39
41
 
40
42
 
41
43
  @main_wrapper
42
44
  def main():
43
45
 
44
- if ARGS_PARSER.parse_config: # Report selected variables and return
45
- _report_variables()
46
+ if ARGS_PARSER.report_variables is not None: # Report selected variables and return
47
+ _report_variables(ARGS_PARSER.report_variables)
46
48
  return
47
49
 
48
50
  # Generate a JSON list of resources if there are multiple YDIDs
@@ -281,31 +283,29 @@ def show_details(ydid: str, initial_indent: int = 0, with_final_comma: bool = Fa
281
283
  print_error(f"Unable to show details for '{ydid}': {e}")
282
284
 
283
285
 
284
- def _report_variables():
286
+ def _report_variables(variable_names: List[str]):
285
287
  """
286
288
  Convenience function to report the processed values of user variables.
287
289
  """
288
- data = (
289
- {}
290
- if ARGS_PARSER.report_variables is None
291
- else {
290
+ if "all" in variable_names:
291
+ variables = get_all_user_variables()
292
+ else:
293
+ variables = {
292
294
  variable_name: get_user_variable(variable_name)
293
295
  for variable_name in ARGS_PARSER.report_variables
294
296
  }
295
- )
296
- if ARGS_PARSER.quiet:
297
- print_json(data)
298
- return
297
+ variables_sorted = dict(sorted(variables.items()))
299
298
 
300
- if ARGS_PARSER.report_variables is None:
301
- print_info("No variables selected for reporting")
299
+ if ARGS_PARSER.quiet:
300
+ print_json(variables_sorted)
302
301
  return
303
302
 
304
303
  print_info("Reporting selected variable values:")
305
- for name, value in data.items():
304
+ max_var_name = max(len(name) for name in variables_sorted)
305
+ for name, value in variables_sorted.items():
306
306
  print(
307
307
  f" {name}"
308
- f"{' '* (20 - len(name)) if len(name) < 20 else ''} "
308
+ f"{' '* (max_var_name - len(name))} "
309
309
  f"= {value}"
310
310
  )
311
311
  return
@@ -1202,12 +1202,6 @@ class CLIParser:
1202
1202
  "configured worker pool"
1203
1203
  ),
1204
1204
  )
1205
- parser.add_argument(
1206
- "--parse-config",
1207
- action="store_true",
1208
- required=False,
1209
- help="parse the config and return namespace, tag, username, then exit",
1210
- )
1211
1205
  parser.add_argument(
1212
1206
  "--report-variable",
1213
1207
  "-r",
@@ -1215,9 +1209,10 @@ class CLIParser:
1215
1209
  required=False,
1216
1210
  action="append",
1217
1211
  help=(
1218
- "report the processed value of the specified variable, "
1219
- "when used with '--parse-config; the option can be supplied "
1220
- "multiple times, one per variable"
1212
+ "report the processed value of the specified variable and exit; "
1213
+ "the option can be supplied multiple times, one per variable, "
1214
+ "or use 'all' to report all variables; use with '--quiet' for "
1215
+ "output in JSON"
1221
1216
  ),
1222
1217
  metavar="<var>",
1223
1218
  )
@@ -1330,11 +1325,6 @@ class CLIParser:
1330
1325
  def print_pid(self) -> Optional[bool]:
1331
1326
  return self.args.print_pid
1332
1327
 
1333
- @property
1334
- @allow_missing_attribute
1335
- def parse_config(self) -> Optional[bool]:
1336
- return self.args.parse_config
1337
-
1338
1328
  @property
1339
1329
  @allow_missing_attribute
1340
1330
  def no_config(self) -> Optional[bool]:
@@ -137,6 +137,13 @@ def get_user_variable(variable_name: str) -> Optional[str]:
137
137
  return VARIABLE_SUBSTITUTIONS.get(variable_name)
138
138
 
139
139
 
140
+ def get_all_user_variables() -> Dict:
141
+ """
142
+ Return all the user variables.
143
+ """
144
+ return VARIABLE_SUBSTITUTIONS
145
+
146
+
140
147
  def process_variable_substitutions_insitu(
141
148
  data: Union[Dict, List], prefix: str = "", postfix: str = ""
142
149
  ) -> Union[Dict, List]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yellowdog-python-examples
3
- Version: 8.4.2
3
+ Version: 8.4.3
4
4
  Summary: Python CLI commands using the YellowDog Python SDK
5
5
  Author-email: YellowDog Limited <support@yellowdog.co>
6
6
  License-Expression: Apache-2.0
@@ -1 +0,0 @@
1
- __version__ = "8.4.2"