outerbounds 0.3.168rc0__py3-none-any.whl → 0.3.169__py3-none-any.whl

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.
@@ -3,7 +3,7 @@ import os
3
3
  from os import path
4
4
  from typing import Any, Dict
5
5
  from outerbounds._vendor import click
6
-
6
+ from collections import OrderedDict
7
7
  from ..utils.utils import safe_write_to_disk
8
8
 
9
9
 
@@ -17,29 +17,22 @@ def _get_ob_provider():
17
17
  class SecretOutput:
18
18
  def __init__(self, type):
19
19
  self.type = type
20
- self._secrets = []
20
+ self._secrets = OrderedDict()
21
21
 
22
- def consume(self, secret_dict):
23
- self._secrets.append(secret_dict)
22
+ def consume(self, secret_id, secret_dict):
23
+ self._secrets[secret_id] = secret_dict
24
24
 
25
25
  def parse(self):
26
26
  if self.type == "text":
27
- return "\n".join(
28
- [f"{k}={v}" for secret in self._secrets for k, v in secret.items()]
29
- )
30
- elif self.type == "json":
31
- secrets = {}
32
- for secret in self._secrets:
33
- secrets.update(secret)
34
- return json.dumps(secrets)
35
- elif self.type == "shell":
36
27
  return "\n".join(
37
28
  [
38
- f"export {k}={v}"
39
- for secret in self._secrets
29
+ f"{k}={v}"
30
+ for _, secret in self._secrets.items()
40
31
  for k, v in secret.items()
41
32
  ]
42
33
  )
34
+ elif self.type == "json":
35
+ return json.dumps(self._secrets)
43
36
 
44
37
 
45
38
  @click.group()
@@ -54,9 +47,8 @@ def secrets(**kwargs):
54
47
 
55
48
  FORMAT_HELP = """
56
49
  Format of the output. When you specify:
57
- - `text`: The output will be in `key=value` format. All secrets will be printed on new lines.
58
- - `json`: The output will be in JSON format. All secrets will be combined into a single dictionary so if secrets have overlapping keys, the last one will take precedence.
59
- - `shell`: The output will be a shell script that exports all secrets as environment variables.
50
+ - `text`: The output will be in `key=value` format. Each key-value pair in each secret will in a new line.
51
+ - `json`: The output will be in JSON format. The secrets will be in a dictionary with the structure `{<secret-id>: {<key>: <value>, ...}, ...}`.
60
52
  """
61
53
 
62
54
 
@@ -107,7 +99,7 @@ def get(
107
99
  output = SecretOutput(format)
108
100
  for secret_id in secret_ids:
109
101
  secret = provider.get_secret_as_dict(secret_id, role=role)
110
- output.consume(secret)
102
+ output.consume(secret_id, secret)
111
103
  output_str = output.parse()
112
104
  if output_file:
113
105
  output_file = os.path.abspath(output_file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: outerbounds
3
- Version: 0.3.168rc0
3
+ Version: 0.3.169
4
4
  Summary: More Data Science, Less Administration
5
5
  License: Proprietary
6
6
  Keywords: data science,machine learning,MLOps
@@ -28,9 +28,9 @@ Requires-Dist: google-auth (>=2.27.0,<3.0.0) ; extra == "gcp"
28
28
  Requires-Dist: google-cloud-secret-manager (>=2.20.0,<3.0.0) ; extra == "gcp"
29
29
  Requires-Dist: google-cloud-storage (>=2.14.0,<3.0.0) ; extra == "gcp"
30
30
  Requires-Dist: metaflow-checkpoint (==0.2.1)
31
- Requires-Dist: ob-metaflow (==2.15.11.2)
32
- Requires-Dist: ob-metaflow-extensions (==1.1.155rc0)
33
- Requires-Dist: ob-metaflow-stubs (==6.0.3.168rc0)
31
+ Requires-Dist: ob-metaflow (==2.15.14.1)
32
+ Requires-Dist: ob-metaflow-extensions (==1.1.156)
33
+ Requires-Dist: ob-metaflow-stubs (==6.0.3.169)
34
34
  Requires-Dist: opentelemetry-distro (>=0.41b0) ; extra == "otel"
35
35
  Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.20.0) ; extra == "otel"
36
36
  Requires-Dist: opentelemetry-instrumentation-requests (>=0.41b0) ; extra == "otel"
@@ -46,7 +46,7 @@ outerbounds/command_groups/cli.py,sha256=de4_QY1UeoKX6y-IXIbmklAi6bz0DsdBSmAoCg6
46
46
  outerbounds/command_groups/fast_bakery_cli.py,sha256=5kja7v6C651XAY6dsP_IkBPJQgfU4hA4S9yTOiVPhW0,6213
47
47
  outerbounds/command_groups/local_setup_cli.py,sha256=tuuqJRXQ_guEwOuQSIf9wkUU0yg8yAs31myGViAK15s,36364
48
48
  outerbounds/command_groups/perimeters_cli.py,sha256=iF_Uw7ROiSctf6FgoJEy30iDBLVE1j9FKuR3shgJRmc,19050
49
- outerbounds/command_groups/secrets_cli.py,sha256=PRV_pV1JEGkgSKQop6Qq_W4o2lcK3b7rNH2P-S8nY-8,3250
49
+ outerbounds/command_groups/secrets_cli.py,sha256=Vgn_aiTo76a0s5hCJhNWEOrCVhyYeivD08ooQxz0y7c,2952
50
50
  outerbounds/command_groups/tutorials_cli.py,sha256=UInFyiMqtscHFfi8YQwiY_6Sdw9quJOtRu5OukEBccw,3522
51
51
  outerbounds/command_groups/workstations_cli.py,sha256=V5Jbj1cVb4IRllI7fOgNgL6OekRpuFDv6CEhDb4xC6w,22016
52
52
  outerbounds/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -55,7 +55,7 @@ outerbounds/utils/metaflowconfig.py,sha256=l2vJbgPkLISU-XPGZFaC8ZKmYFyJemlD6bwB-
55
55
  outerbounds/utils/schema.py,sha256=lMUr9kNgn9wy-sO_t_Tlxmbt63yLeN4b0xQXbDUDj4A,2331
56
56
  outerbounds/utils/utils.py,sha256=4Z8cszNob_8kDYCLNTrP-wWads_S_MdL3Uj3ju4mEsk,501
57
57
  outerbounds/vendor.py,sha256=gRLRJNXtZBeUpPEog0LOeIsl6GosaFFbCxUvR4bW6IQ,5093
58
- outerbounds-0.3.168rc0.dist-info/METADATA,sha256=cQyn3eWluj6w2YUCcpNTWXr6vZk7DncpRZu4LM6wvAU,1846
59
- outerbounds-0.3.168rc0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
60
- outerbounds-0.3.168rc0.dist-info/entry_points.txt,sha256=7ye0281PKlvqxu15rjw60zKg2pMsXI49_A8BmGqIqBw,47
61
- outerbounds-0.3.168rc0.dist-info/RECORD,,
58
+ outerbounds-0.3.169.dist-info/METADATA,sha256=UIb5MVvhx9RrnCqEkJMlr2UacbcrChMutC6W0aDdNV4,1837
59
+ outerbounds-0.3.169.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
60
+ outerbounds-0.3.169.dist-info/entry_points.txt,sha256=7ye0281PKlvqxu15rjw60zKg2pMsXI49_A8BmGqIqBw,47
61
+ outerbounds-0.3.169.dist-info/RECORD,,