yellowdog-python-examples 8.3.1__tar.gz → 8.4.0__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.3.1 → yellowdog_python_examples-8.4.0}/PKG-INFO +3 -3
  2. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/README.md +1 -0
  3. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/requirements.txt +2 -2
  4. yellowdog_python_examples-8.4.0/yellowdog_cli/__init__.py +1 -0
  5. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/follow.py +5 -0
  6. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/show.py +25 -1
  7. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/submit.py +6 -0
  8. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/args.py +14 -1
  9. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/config_types.py +1 -0
  10. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/csv_data.py +5 -2
  11. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/entity_utils.py +14 -9
  12. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/load_config.py +8 -4
  13. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/property_names.py +2 -0
  14. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/settings.py +1 -0
  15. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/variables.py +5 -2
  16. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_python_examples.egg-info/PKG-INFO +3 -3
  17. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_python_examples.egg-info/requires.txt +4 -2
  18. yellowdog_python_examples-8.3.1/yellowdog_cli/__init__.py +0 -1
  19. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/LICENSE +0 -0
  20. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/PYPI_README.md +0 -0
  21. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/pyproject.toml +0 -0
  22. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/setup.cfg +0 -0
  23. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/tests/test_create_remove.py +0 -0
  24. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/tests/test_demos.py +0 -0
  25. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/tests/test_dryruns.py +0 -0
  26. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/tests/test_entrypoints.py +0 -0
  27. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/tests/test_gui.py +0 -0
  28. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/tests/test_list.py +0 -0
  29. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/tests/test_objects.py +0 -0
  30. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/tests/test_variable_processing.py +0 -0
  31. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/abort.py +0 -0
  32. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/admin.py +0 -0
  33. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/application.py +0 -0
  34. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/boost.py +0 -0
  35. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/cancel.py +0 -0
  36. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/cloudwizard.py +0 -0
  37. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/compare.py +0 -0
  38. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/create.py +0 -0
  39. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/delete.py +0 -0
  40. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/download.py +0 -0
  41. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/finish.py +0 -0
  42. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/format_json.py +0 -0
  43. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/hold.py +0 -0
  44. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/instantiate.py +0 -0
  45. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/jsonnet2json.py +0 -0
  46. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/list.py +0 -0
  47. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/provision.py +0 -0
  48. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/remove.py +0 -0
  49. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/resize.py +0 -0
  50. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/shutdown.py +0 -0
  51. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/start.py +0 -0
  52. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/terminate.py +0 -0
  53. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/upload.py +0 -0
  54. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/__init__.py +0 -0
  55. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/check_imports.py +0 -0
  56. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/cloudwizard_aws.py +0 -0
  57. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/cloudwizard_aws_types.py +0 -0
  58. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/cloudwizard_azure.py +0 -0
  59. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/cloudwizard_common.py +0 -0
  60. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/cloudwizard_gcp.py +0 -0
  61. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/compact_json.py +0 -0
  62. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/follow_utils.py +0 -0
  63. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/interactive.py +0 -0
  64. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/items.py +0 -0
  65. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/load_resources.py +0 -0
  66. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/misc_utils.py +0 -0
  67. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/printing.py +0 -0
  68. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/provision_utils.py +0 -0
  69. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/rich_console_input_fixed.py +0 -0
  70. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/start_hold_common.py +0 -0
  71. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/submit_utils.py +0 -0
  72. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/type_check.py +0 -0
  73. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/upload_utils.py +0 -0
  74. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/validate_properties.py +0 -0
  75. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/wrapper.py +0 -0
  76. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/utils/ydid_utils.py +0 -0
  77. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_cli/version.py +0 -0
  78. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_python_examples.egg-info/SOURCES.txt +0 -0
  79. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_python_examples.egg-info/dependency_links.txt +0 -0
  80. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/yellowdog_python_examples.egg-info/entry_points.txt +0 -0
  81. {yellowdog_python_examples-8.3.1 → yellowdog_python_examples-8.4.0}/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.3.1
3
+ Version: 8.4.0
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
@@ -25,8 +25,8 @@ Requires-Dist: python-dotenv
25
25
  Requires-Dist: requests
26
26
  Requires-Dist: rich==13.9.4
27
27
  Requires-Dist: tabulate>=0.9.0
28
- Requires-Dist: toml
29
- Requires-Dist: yellowdog-sdk>=12.0.0
28
+ Requires-Dist: tomli>=2.4.0; python_version < "3.11"
29
+ Requires-Dist: yellowdog-sdk>=13.1.0
30
30
  Provides-Extra: jsonnet
31
31
  Requires-Dist: jsonnet; extra == "jsonnet"
32
32
  Provides-Extra: cloudwizard
@@ -622,6 +622,7 @@ All properties are optional except for **`taskType`** (or **`taskTypes`**).
622
622
  | `csvFiles` | A list of CSV files used to derive Task data. E.g. `["file.csv", "file_2.csv:2]`. | Yes | | | |
623
623
  | `dependencies` | The names of other Task Groups within the same Work Requirement that must be successfully completed before the Task Group is started. E.g. `["task_group_1", "task_group_2"]`. | | | Yes | |
624
624
  | `dependentOn` | [Deprecated in favour of `dependencies`] The name of another Task Group within the same Work Requirement that must be successfully completed before the Task Group is started. E.g. `"task_group_1"`. | | | Yes | |
625
+ | `disablePreallocation` | If `true`, tasks are only allocated to nodes as workers become idle and are not queued on the node. Default: `false`. | Yes | Yes | Yes | |
625
626
  | `dockerEnvironment` | The environment to be passed to a Docker container. Only used by the `docker` Task Type. E.g., JSON: `{"VAR_1": "abc"}`, TOML: `{VAR_1 = "abc", VAR_2 = "def"}`. | Yes | Yes | Yes | Yes |
626
627
  | `dockerOptions` | Additional options to be passed to the docker run command. Only used by the `docker` Task Type. E.g.,`["--runtime nvidia, "--gpus all"]`. | Yes | Yes | Yes | Yes |
627
628
  | `dockerPassword` | The password for the Docker container registry; only used by the `docker` Task Type. E,g., `"my_password"`. | Yes | Yes | Yes | Yes |
@@ -4,5 +4,5 @@ python-dotenv
4
4
  requests
5
5
  rich == 13.9.4
6
6
  tabulate >= 0.9.0
7
- toml
8
- yellowdog-sdk >= 12.0.0
7
+ tomli >= 2.4.0; python_version < "3.11"
8
+ yellowdog-sdk >= 13.1.0
@@ -0,0 +1 @@
1
+ __version__ = "8.4.0"
@@ -5,11 +5,16 @@ A script to follow event streams.
5
5
  """
6
6
 
7
7
  from yellowdog_cli.utils.follow_utils import follow_ids
8
+ from yellowdog_cli.utils.printing import print_info
8
9
  from yellowdog_cli.utils.wrapper import ARGS_PARSER, main_wrapper
9
10
 
10
11
 
11
12
  @main_wrapper
12
13
  def main():
14
+ if len(ARGS_PARSER.yellowdog_ids) == 0:
15
+ print_info("No YellowDog IDs to follow")
16
+ return
17
+
13
18
  follow_ids(ARGS_PARSER.yellowdog_ids, ARGS_PARSER.auto_cr)
14
19
 
15
20
 
@@ -16,6 +16,7 @@ from yellowdog_cli.utils.entity_utils import (
16
16
  from yellowdog_cli.utils.printing import (
17
17
  print_error,
18
18
  print_info,
19
+ print_json,
19
20
  print_to_file,
20
21
  print_yd_object,
21
22
  )
@@ -32,13 +33,36 @@ from yellowdog_cli.utils.settings import (
32
33
  RN_ROLE,
33
34
  RN_SOURCE_TEMPLATE,
34
35
  )
35
- from yellowdog_cli.utils.wrapper import ARGS_PARSER, CLIENT, main_wrapper
36
+ from yellowdog_cli.utils.variables import USERNAME
37
+ from yellowdog_cli.utils.wrapper import ARGS_PARSER, CLIENT, CONFIG_COMMON, main_wrapper
36
38
  from yellowdog_cli.utils.ydid_utils import YDIDType, get_ydid_type
37
39
 
38
40
 
39
41
  @main_wrapper
40
42
  def main():
41
43
 
44
+ if ARGS_PARSER.parse_config:
45
+ if ARGS_PARSER.quiet:
46
+ # Output properties in JSON format
47
+ print_json(
48
+ {
49
+ "namespace": CONFIG_COMMON.namespace,
50
+ "tag": CONFIG_COMMON.name_tag,
51
+ "username": USERNAME,
52
+ }
53
+ )
54
+ else:
55
+ # Print properties inline
56
+ print_info("Showing configuration values:")
57
+ print(f" namespace = {CONFIG_COMMON.namespace}")
58
+ print(f" tag = {CONFIG_COMMON.name_tag}")
59
+ print(f" username = {USERNAME}")
60
+ return
61
+
62
+ if len(ARGS_PARSER.yellowdog_ids) == 0:
63
+ print_info("No YellowDog IDs to show")
64
+ return
65
+
42
66
  # Generate a JSON list of resources if there are multiple YDIDs
43
67
  # and the 'quiet' option is enabled
44
68
  generate_json_list = len(ARGS_PARSER.yellowdog_ids) > 1 and ARGS_PARSER.quiet
@@ -544,6 +544,12 @@ def create_task_group(
544
544
  retryableErrors=generate_task_error_matchers_list(
545
545
  config_wr, wr_data, task_group_data
546
546
  ),
547
+ disablePreallocation=check_bool(
548
+ task_group_data.get(
549
+ DISABLE_PREALLOCTAION,
550
+ wr_data.get(DISABLE_PREALLOCTAION, config_wr.disable_prealloaction),
551
+ )
552
+ ),
547
553
  )
548
554
  ctttl_data = check_float_or_int(
549
555
  task_group_data.get(
@@ -994,13 +994,21 @@ class CLIParser:
994
994
  verb = "follow" if "follow" in sys.argv[0] else "show"
995
995
  parser.add_argument(
996
996
  "yellowdog_ids",
997
- nargs="+",
997
+ nargs="*",
998
998
  default=[],
999
999
  metavar="<yellowdog-id>",
1000
1000
  type=str,
1001
1001
  help=f"the YellowDog ID(s) of the item(s) to {verb}",
1002
1002
  )
1003
1003
 
1004
+ if any(module in sys.argv[0] for module in ["show"]):
1005
+ parser.add_argument(
1006
+ "--parse-config",
1007
+ action="store_true",
1008
+ required=False,
1009
+ help="parse the config and return namespace, tag, username, then exit",
1010
+ )
1011
+
1004
1012
  if any(
1005
1013
  module in sys.argv[0]
1006
1014
  for module in ["upload", "submit", "provision", "instantiate"]
@@ -1311,6 +1319,11 @@ class CLIParser:
1311
1319
  def print_pid(self) -> Optional[bool]:
1312
1320
  return self.args.print_pid
1313
1321
 
1322
+ @property
1323
+ @allow_missing_attribute
1324
+ def parse_config(self) -> Optional[bool]:
1325
+ return self.args.parse_config
1326
+
1314
1327
  @property
1315
1328
  @allow_missing_attribute
1316
1329
  def no_config(self) -> Optional[bool]:
@@ -26,6 +26,7 @@ class ConfigWorkRequirement:
26
26
  batch_allocation: Optional[bool] = None
27
27
  completed_task_ttl: Optional[float] = None # In minutes
28
28
  csv_files: Optional[List[str]] = None
29
+ disable_prealloaction: Optional[bool] = None
29
30
  docker_env: Optional[Dict] = None
30
31
  docker_options: Optional[List] = None
31
32
  docker_password: Optional[str] = None
@@ -10,7 +10,10 @@ from json import load as json_load
10
10
  from os.path import relpath
11
11
  from typing import Dict, List, Optional, Tuple
12
12
 
13
- from toml import load as toml_load
13
+ try:
14
+ from tomllib import load as toml_load # Available in Python 3.11+
15
+ except ImportError:
16
+ from tomli import load as toml_load # Fallback for 3.9 and 3.10
14
17
 
15
18
  from yellowdog_cli.utils.args import ARGS_PARSER
16
19
  from yellowdog_cli.utils.config_types import ConfigWorkRequirement
@@ -165,7 +168,7 @@ def load_toml_file_with_csv_task_expansion(
165
168
  data.
166
169
  """
167
170
 
168
- with open(resolve_filename(files_directory, toml_file), "r") as f:
171
+ with open(resolve_filename(files_directory, toml_file), "rb") as f:
169
172
  wr_data = toml_load(f)
170
173
 
171
174
  return perform_csv_task_expansion(wr_data, csv_files, files_directory)
@@ -921,7 +921,7 @@ def get_application_id_by_name(client: PlatformClient, app_name: str) -> Optiona
921
921
  @lru_cache
922
922
  def get_application_details(client: PlatformClient) -> ApplicationDetails:
923
923
  """
924
- Load and cache the Application's details
924
+ Load and cache the Application's details.
925
925
  """
926
926
  return client.application_client.get_application_details()
927
927
 
@@ -952,23 +952,28 @@ def get_all_roles_and_namespaces_for_application(
952
952
  client: PlatformClient, application_id: str
953
953
  ) -> Dict:
954
954
  """
955
- Get a list of roles and the namespaces to which they apply, for a given application.
955
+ Get a list of roles and the namespaces to which they apply, for a given
956
+ application.
957
+
956
958
  Returns {role_name: [namespace, ...]}, sorted by role name.
957
959
  """
958
- # Iterate through groups, roles, accumulate namespaces
960
+ # Iterate through groups, roles, accumulate unique namespaces
959
961
  roles = dict()
960
962
  for group in get_application_groups(client, application_id):
961
963
  for role in group.roles:
962
964
  if roles.get(role.role.name) is None:
963
- roles[role.role.name] = []
965
+ # Set of namespaces to suppress duplicates
966
+ roles[role.role.name] = set()
964
967
  if role.scope.global_:
965
- roles[role.role.name] += ["GLOBAL"]
968
+ roles[role.role.name].update(["GLOBAL"])
966
969
  else:
967
- roles[role.role.name] += [
968
- namespace.namespace for namespace in role.scope.namespaces
969
- ]
970
+ roles[role.role.name].update(
971
+ [namespace.namespace for namespace in role.scope.namespaces]
972
+ )
970
973
 
971
- return {role: namespaces for role, namespaces in sorted(roles.items())}
974
+ return {
975
+ role: sorted(list(namespaces)) for role, namespaces in sorted(roles.items())
976
+ }
972
977
 
973
978
 
974
979
  def clear_application_caches():
@@ -9,7 +9,10 @@ from pathlib import Path
9
9
  from sys import exit
10
10
  from typing import Dict
11
11
 
12
- from toml import TomlDecodeError
12
+ try:
13
+ from tomllib import TOMLDecodeError # Available in Python 3.11+
14
+ except ImportError:
15
+ from tomli import TOMLDecodeError # Fallback for 3.9 and 3.10
13
16
 
14
17
  from yellowdog_cli.utils.args import ARGS_PARSER
15
18
  from yellowdog_cli.utils.config_types import (
@@ -102,7 +105,7 @@ else:
102
105
  CONFIG_TOML = {COMMON_SECTION: {}}
103
106
  CONFIG_FILE_DIR = os.getcwd()
104
107
 
105
- except (PermissionError, TomlDecodeError) as e:
108
+ except (PermissionError, TOMLDecodeError) as e:
106
109
  print_error(
107
110
  f"Unable to load configuration data from '{CONFIG_FILE}': {e}",
108
111
  )
@@ -196,7 +199,7 @@ def load_config_common() -> ConfigCommon:
196
199
  print_info(
197
200
  f"Setting environment variable '{requests_ca_bundle}' to '{certificates}'"
198
201
  )
199
- os.environ["REQUESTS_CA_BUNDLE"] = certificates
202
+ os.environ[requests_ca_bundle] = certificates
200
203
 
201
204
  return ConfigCommon(
202
205
  # Required
@@ -222,7 +225,7 @@ def import_toml(filename: str) -> Dict:
222
225
  try:
223
226
  common_config: Dict = load_toml_file_with_variable_substitutions(filename)
224
227
  return common_config[COMMON_SECTION]
225
- except (FileNotFoundError, PermissionError, TomlDecodeError) as e:
228
+ except (FileNotFoundError, PermissionError, TOMLDecodeError) as e:
226
229
  print_error(f"Unable to load imported common configuration data: {e}")
227
230
  exit(1)
228
231
 
@@ -313,6 +316,7 @@ def load_config_work_requirement() -> ConfigWorkRequirement:
313
316
  upload_taskoutput=wr_section.get(UPLOAD_TASKOUTPUT, False),
314
317
  completed_task_ttl=wr_section.get(COMPLETED_TASK_TTL, None),
315
318
  csv_files=csv_files,
319
+ disable_prealloaction=wr_section.get(DISABLE_PREALLOCTAION, None),
316
320
  docker_env=wr_section.get(DOCKER_ENV, None),
317
321
  docker_options=wr_section.get(DOCKER_OPTIONS, None),
318
322
  docker_password=wr_section.get(DOCKER_PASSWORD, None),
@@ -15,6 +15,7 @@ COMPUTE_REQUIREMENT_SECTION = "computeRequirement" # No value
15
15
  CR_TAG = "requirementTag" # String
16
16
  CSV_FILE = "csvFile" # String
17
17
  CSV_FILES = "csvFiles" # List of Strings
18
+ DISABLE_PREALLOCTAION = "disablePreallocation"
18
19
  DEPENDENCIES = "dependencies" # List of Strings
19
20
  DEPENDENT_ON = "dependentOn" # String (Deprecated)
20
21
  DIRECTORY_NAME = "directoryName" # String
@@ -130,6 +131,7 @@ ALL_KEYS = [
130
131
  CR_TAG,
131
132
  CSV_FILE,
132
133
  CSV_FILES,
134
+ DISABLE_PREALLOCTAION,
133
135
  DEPENDENCIES,
134
136
  DEPENDENT_ON,
135
137
  DIRECTORY_NAME,
@@ -66,6 +66,7 @@ HIGHLIGHTED_STATES = [
66
66
  r"(?P<active>ALIVE)",
67
67
  r"(?P<active>MATCHING)",
68
68
  r"(?P<active>MAYBE MATCHING)",
69
+ r"(?P<active>FINISHING)",
69
70
  r"(?P<cancelled>ABORTED)",
70
71
  r"(?P<cancelled>CANCELLED)",
71
72
  r"(?P<cancelled>CANCELLING)",
@@ -12,7 +12,10 @@ from json import loads as json_loads
12
12
  from random import randint
13
13
  from typing import Dict, List, Optional, Union
14
14
 
15
- from toml import load as toml_load
15
+ try:
16
+ from tomllib import load as toml_load # Available in Python 3.11+
17
+ except ImportError:
18
+ from tomli import load as toml_load # Fallback for 3.9 and 3.10
16
19
 
17
20
  from yellowdog_cli.utils.args import ARGS_PARSER
18
21
  from yellowdog_cli.utils.check_imports import check_jsonnet_import
@@ -493,7 +496,7 @@ def load_toml_file_with_variable_substitutions(
493
496
  Takes a TOML filename and returns a dictionary with its variable
494
497
  substitutions processed.
495
498
  """
496
- with open(resolve_filename(files_directory, filename), "r") as f:
499
+ with open(resolve_filename(files_directory, filename), "rb") as f:
497
500
  config = toml_load(f)
498
501
 
499
502
  # Add any variable substitutions in the TOML file before processing the
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yellowdog-python-examples
3
- Version: 8.3.1
3
+ Version: 8.4.0
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
@@ -25,8 +25,8 @@ Requires-Dist: python-dotenv
25
25
  Requires-Dist: requests
26
26
  Requires-Dist: rich==13.9.4
27
27
  Requires-Dist: tabulate>=0.9.0
28
- Requires-Dist: toml
29
- Requires-Dist: yellowdog-sdk>=12.0.0
28
+ Requires-Dist: tomli>=2.4.0; python_version < "3.11"
29
+ Requires-Dist: yellowdog-sdk>=13.1.0
30
30
  Provides-Extra: jsonnet
31
31
  Requires-Dist: jsonnet; extra == "jsonnet"
32
32
  Provides-Extra: cloudwizard
@@ -4,8 +4,10 @@ python-dotenv
4
4
  requests
5
5
  rich==13.9.4
6
6
  tabulate>=0.9.0
7
- toml
8
- yellowdog-sdk>=12.0.0
7
+ yellowdog-sdk>=13.1.0
8
+
9
+ [:python_version < "3.11"]
10
+ tomli>=2.4.0
9
11
 
10
12
  [cloudwizard]
11
13
  boto3
@@ -1 +0,0 @@
1
- __version__ = "8.3.1"