yellowdog-python-examples 7.19.2__tar.gz → 7.19.4__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 (80) hide show
  1. {yellowdog_python_examples-7.19.2/yellowdog_python_examples.egg-info → yellowdog_python_examples-7.19.4}/PKG-INFO +3 -3
  2. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/requirements.txt +2 -2
  3. yellowdog_python_examples-7.19.4/yellowdog_cli/__init__.py +1 -0
  4. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/create.py +4 -1
  5. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/list.py +3 -1
  6. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/misc_utils.py +5 -2
  7. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/printing.py +12 -5
  8. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/ydid_utils.py +1 -1
  9. yellowdog_python_examples-7.19.4/yellowdog_cli/version.py +41 -0
  10. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4/yellowdog_python_examples.egg-info}/PKG-INFO +3 -3
  11. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_python_examples.egg-info/requires.txt +2 -2
  12. yellowdog_python_examples-7.19.2/yellowdog_cli/__init__.py +0 -1
  13. yellowdog_python_examples-7.19.2/yellowdog_cli/version.py +0 -40
  14. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/LICENSE +0 -0
  15. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/PYPI_README.md +0 -0
  16. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/README.md +0 -0
  17. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/pyproject.toml +0 -0
  18. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/setup.cfg +0 -0
  19. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/tests/test_create_remove.py +0 -0
  20. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/tests/test_demos.py +0 -0
  21. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/tests/test_dryruns.py +0 -0
  22. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/tests/test_entrypoints.py +0 -0
  23. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/tests/test_gui.py +0 -0
  24. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/tests/test_list.py +0 -0
  25. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/tests/test_objects.py +0 -0
  26. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/tests/test_variable_processing.py +0 -0
  27. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/abort.py +0 -0
  28. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/admin.py +0 -0
  29. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/boost.py +0 -0
  30. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/cancel.py +0 -0
  31. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/cloudwizard.py +0 -0
  32. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/compare.py +0 -0
  33. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/delete.py +0 -0
  34. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/download.py +0 -0
  35. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/follow.py +0 -0
  36. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/format_json.py +0 -0
  37. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/hold.py +0 -0
  38. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/instantiate.py +0 -0
  39. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/jsonnet2json.py +0 -0
  40. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/provision.py +0 -0
  41. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/remove.py +0 -0
  42. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/resize.py +0 -0
  43. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/show.py +0 -0
  44. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/shutdown.py +0 -0
  45. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/start.py +0 -0
  46. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/submit.py +0 -0
  47. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/terminate.py +0 -0
  48. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/upload.py +0 -0
  49. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/__init__.py +0 -0
  50. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/args.py +0 -0
  51. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/check_imports.py +0 -0
  52. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/cloudwizard_aws.py +0 -0
  53. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/cloudwizard_aws_types.py +0 -0
  54. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/cloudwizard_azure.py +0 -0
  55. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/cloudwizard_common.py +0 -0
  56. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/cloudwizard_gcp.py +0 -0
  57. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/compact_json.py +0 -0
  58. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/config_types.py +0 -0
  59. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/csv_data.py +0 -0
  60. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/entity_utils.py +0 -0
  61. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/follow_utils.py +0 -0
  62. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/interactive.py +0 -0
  63. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/items.py +0 -0
  64. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/load_config.py +0 -0
  65. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/load_resources.py +0 -0
  66. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/property_names.py +0 -0
  67. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/provision_utils.py +0 -0
  68. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/rich_console_input_fixed.py +0 -0
  69. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/settings.py +0 -0
  70. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/start_hold_common.py +0 -0
  71. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/submit_utils.py +0 -0
  72. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/type_check.py +0 -0
  73. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/upload_utils.py +0 -0
  74. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/validate_properties.py +0 -0
  75. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/variables.py +0 -0
  76. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_cli/utils/wrapper.py +0 -0
  77. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_python_examples.egg-info/SOURCES.txt +0 -0
  78. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_python_examples.egg-info/dependency_links.txt +0 -0
  79. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/yellowdog_python_examples.egg-info/entry_points.txt +0 -0
  80. {yellowdog_python_examples-7.19.2 → yellowdog_python_examples-7.19.4}/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: 7.19.2
3
+ Version: 7.19.4
4
4
  Summary: Python CLI commands using the YellowDog Python SDK
5
5
  Author-email: YellowDog Limited <support@yellowdog.co>
6
6
  Project-URL: Homepage, https://github.com/yellowdog/python-examples
@@ -15,12 +15,12 @@ Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Requires-Dist: PyPAC>=0.16.4
17
17
  Requires-Dist: dateparser
18
- Requires-Dist: dotenv
18
+ Requires-Dist: python-dotenv
19
19
  Requires-Dist: requests
20
20
  Requires-Dist: rich==13.9.4
21
21
  Requires-Dist: tabulate>=0.9.0
22
22
  Requires-Dist: toml
23
- Requires-Dist: yellowdog-sdk>=9.5.0
23
+ Requires-Dist: yellowdog-sdk>=10.0.0
24
24
  Provides-Extra: jsonnet
25
25
  Requires-Dist: jsonnet; extra == "jsonnet"
26
26
  Provides-Extra: cloudwizard
@@ -1,8 +1,8 @@
1
1
  PyPAC >= 0.16.4
2
2
  dateparser
3
- dotenv
3
+ python-dotenv
4
4
  requests
5
5
  rich == 13.9.4
6
6
  tabulate >= 0.9.0
7
7
  toml
8
- yellowdog-sdk >= 9.5.0
8
+ yellowdog-sdk >= 10.0.0
@@ -0,0 +1 @@
1
+ __version__ = "7.19.4"
@@ -34,6 +34,7 @@ from yellowdog_client.model import (
34
34
  NamespacePolicy,
35
35
  NamespaceStorageConfiguration,
36
36
  RequirementsAllowance,
37
+ RoleScope,
37
38
  SourceAllowance,
38
39
  SourcesAllowance,
39
40
  User,
@@ -981,7 +982,9 @@ def create_group(resource: Dict):
981
982
 
982
983
  role_ids_to_add = new_role_ids - current_role_ids
983
984
  for role_id in role_ids_to_add:
984
- CLIENT.account_client.add_role_to_group(group.id, role_id)
985
+ CLIENT.account_client.add_role_to_group(
986
+ group.id, role_id, RoleScope(global_=True)
987
+ )
985
988
  print_log(
986
989
  f"Added Role '{get_role_name_by_id(CLIENT, role_id)}' "
987
990
  f"to Group ({role_id})"
@@ -697,7 +697,9 @@ def list_image_families():
697
697
  """
698
698
  image_search = MachineImageFamilySearch(
699
699
  includePublic=True,
700
- namespace=CONFIG_COMMON.namespace, # Supports partial match
700
+ namespace=(
701
+ None if CONFIG_COMMON.namespace is "" else CONFIG_COMMON.namespace
702
+ ), # Supports partial match
701
703
  familyName=CONFIG_COMMON.name_tag, # Supports partial match
702
704
  )
703
705
  search_client: SearchClient = CLIENT.images_client.get_image_families(image_search)
@@ -7,7 +7,7 @@ import re
7
7
  from dataclasses import dataclass
8
8
  from datetime import datetime, timezone
9
9
  from os.path import join, normpath, relpath
10
- from typing import List, Optional
10
+ from typing import List, Optional, Tuple
11
11
  from urllib.parse import urlparse
12
12
 
13
13
  from dotenv import dotenv_values, find_dotenv, load_dotenv
@@ -25,17 +25,20 @@ from yellowdog_cli.utils.settings import NAMESPACE_OBJECT_STORE_PREFIX_SEPARATOR
25
25
  UTCNOW = datetime.now(timezone.utc)
26
26
 
27
27
 
28
- def unpack_namespace_in_prefix(namespace: str, prefix: str) -> (str, str):
28
+ def unpack_namespace_in_prefix(namespace: str, prefix: str) -> Tuple[str, str]:
29
29
  """
30
30
  Allow the prefix to include the namespace, which can override the supplied
31
31
  namespace. Return the unpacked (namespace, prefix) tuple.
32
32
  """
33
33
  elems = prefix.split(NAMESPACE_OBJECT_STORE_PREFIX_SEPARATOR)
34
+
34
35
  if len(elems) == 1:
35
36
  return namespace, prefix.lstrip("/")
36
37
  if len(elems) == 2:
37
38
  return elems[0] if elems[0] != "" else namespace, elems[1].lstrip("/")
38
39
 
40
+ raise Exception(f"Cannot unpack '{namespace}/{prefix}")
41
+
39
42
 
40
43
  def pathname_relative_to_config_file(config_file_dir: str, file: str) -> str:
41
44
  """
@@ -632,7 +632,7 @@ def workers_table(
632
632
  "Worker Tag",
633
633
  "Status",
634
634
  "Claims",
635
- "Exclusive?",
635
+ "Exclusive",
636
636
  "Worker ID",
637
637
  ]
638
638
  table = []
@@ -645,7 +645,7 @@ def workers_table(
645
645
  worker.workerTag,
646
646
  worker.status,
647
647
  worker.claimCount,
648
- worker.exclusive,
648
+ _yes_or_no(worker.exclusive),
649
649
  worker.id,
650
650
  ]
651
651
  )
@@ -748,7 +748,7 @@ def namespaces_table(
748
748
  index + 1,
749
749
  namespace.namespace,
750
750
  namespace.id,
751
- "Yes" if namespace.deletable else "No",
751
+ _yes_or_no(namespace.deletable),
752
752
  ]
753
753
  )
754
754
  return headers, table
@@ -840,7 +840,7 @@ def groups_table(
840
840
  headers = [
841
841
  "#",
842
842
  "Name",
843
- "Admin Group?",
843
+ "Admin Group",
844
844
  "Description",
845
845
  "Roles",
846
846
  "ID",
@@ -851,7 +851,7 @@ def groups_table(
851
851
  [
852
852
  index + 1,
853
853
  group.name,
854
- group.adminGroup,
854
+ _yes_or_no(group.adminGroup),
855
855
  _truncate_text(group.description),
856
856
  ", ".join([x.role.name for x in group.roles]),
857
857
  group.id,
@@ -1575,3 +1575,10 @@ def _truncate_text(description: Union[str, None]):
1575
1575
  return ""
1576
1576
 
1577
1577
  return f"{description[:MAX_TABLE_DESCRIPTION - 3] + '...' if len(description) > MAX_TABLE_DESCRIPTION else description}"
1578
+
1579
+
1580
+ def _yes_or_no(true_: bool) -> str:
1581
+ """
1582
+ Swap bools into strings.
1583
+ """
1584
+ return "Yes" if true_ else "No"
@@ -30,7 +30,7 @@ class YDIDType(Enum):
30
30
 
31
31
  def get_ydid_type(ydid: Optional[str]) -> Optional[YDIDType]:
32
32
  """
33
- Find the type of a YellowDog ID.
33
+ Find the type of YellowDog ID.
34
34
  """
35
35
  if ydid is None or not ydid.startswith("ydid:"):
36
36
  return None
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """
4
+ Report version numbers, etc.
5
+ """
6
+
7
+ from os.path import abspath
8
+ from sys import argv, executable, path
9
+ from sys import version as py_version
10
+
11
+ from yellowdog_client._version import __version__ as yd_sdk_version
12
+
13
+ from yellowdog_cli.__init__ import __version__
14
+
15
+ DOCS_URL = f"https://github.com/yellowdog/python-examples/blob/v{__version__}/README.md"
16
+
17
+
18
+ def _jsonnet_version() -> str:
19
+ try:
20
+ from _jsonnet import evaluate_file, version
21
+
22
+ # Strip the initial 'v' if present
23
+ return version[1:] if version.startswith("v") else version
24
+ except ImportError:
25
+ return "Not installed"
26
+
27
+
28
+ def main():
29
+ print(f" YellowDog CLI Version: {__version__} (Docs: {DOCS_URL})")
30
+ print(f" YellowDog SDK Version: {yd_sdk_version}")
31
+ print(f" Jsonnet Version: {_jsonnet_version()}")
32
+ print(f" Python Version: {py_version.split()[0]} ")
33
+ if "--debug" in argv:
34
+ print(f" Command: {abspath(__file__)}")
35
+ print(f" Python Executable: {executable}")
36
+ for i, p in enumerate(path, start=1):
37
+ print(f" Path-{str(i).zfill(2)}: {p}")
38
+
39
+
40
+ if __name__ == "__main__":
41
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yellowdog-python-examples
3
- Version: 7.19.2
3
+ Version: 7.19.4
4
4
  Summary: Python CLI commands using the YellowDog Python SDK
5
5
  Author-email: YellowDog Limited <support@yellowdog.co>
6
6
  Project-URL: Homepage, https://github.com/yellowdog/python-examples
@@ -15,12 +15,12 @@ Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Requires-Dist: PyPAC>=0.16.4
17
17
  Requires-Dist: dateparser
18
- Requires-Dist: dotenv
18
+ Requires-Dist: python-dotenv
19
19
  Requires-Dist: requests
20
20
  Requires-Dist: rich==13.9.4
21
21
  Requires-Dist: tabulate>=0.9.0
22
22
  Requires-Dist: toml
23
- Requires-Dist: yellowdog-sdk>=9.5.0
23
+ Requires-Dist: yellowdog-sdk>=10.0.0
24
24
  Provides-Extra: jsonnet
25
25
  Requires-Dist: jsonnet; extra == "jsonnet"
26
26
  Provides-Extra: cloudwizard
@@ -1,11 +1,11 @@
1
1
  PyPAC>=0.16.4
2
2
  dateparser
3
- dotenv
3
+ python-dotenv
4
4
  requests
5
5
  rich==13.9.4
6
6
  tabulate>=0.9.0
7
7
  toml
8
- yellowdog-sdk>=9.5.0
8
+ yellowdog-sdk>=10.0.0
9
9
 
10
10
  [cloudwizard]
11
11
  boto3
@@ -1 +0,0 @@
1
- __version__ = "7.19.2"
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- """
4
- Report version numbers, etc.
5
- """
6
-
7
- from os.path import abspath
8
- from sys import argv, executable, path
9
- from sys import version as py_version
10
-
11
- from yellowdog_client._version import __version__ as yd_sdk_version
12
-
13
- from yellowdog_cli.__init__ import __version__
14
-
15
- DOCS_URL = f"https://github.com/yellowdog/python-examples/blob/v{__version__}/README.md"
16
-
17
-
18
- def check_for_jsonnet() -> str:
19
- try:
20
- from _jsonnet import evaluate_file, version
21
-
22
- return f"Jsonnet is installed ({version})"
23
- except ImportError:
24
- return "Jsonnet is not installed"
25
-
26
-
27
- def main():
28
- print(f" YellowDog Python Examples Version: {__version__} (Docs: {DOCS_URL})")
29
- print(f" Python Jsonnet Support: {check_for_jsonnet()}")
30
- print(f" YellowDog SDK Version: {yd_sdk_version}")
31
- print(f" Python Version: {py_version.split()[0]} ")
32
- if "--debug" in argv:
33
- print(f" Command: {abspath(__file__)}")
34
- print(f" Python Executable: {executable}")
35
- for i, p in enumerate(path, start=1):
36
- print(f" Path-{str(i).zfill(2)}: {p}")
37
-
38
-
39
- if __name__ == "__main__":
40
- main()