metaflow 2.15.19__py2.py3-none-any.whl → 2.15.20__py2.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.
- metaflow/plugins/secrets/__init__.py +1 -1
- metaflow/plugins/secrets/secrets_func.py +29 -40
- metaflow/version.py +1 -1
- {metaflow-2.15.19.dist-info → metaflow-2.15.20.dist-info}/METADATA +2 -2
- {metaflow-2.15.19.dist-info → metaflow-2.15.20.dist-info}/RECORD +12 -12
- {metaflow-2.15.19.data → metaflow-2.15.20.data}/data/share/metaflow/devtools/Makefile +0 -0
- {metaflow-2.15.19.data → metaflow-2.15.20.data}/data/share/metaflow/devtools/Tiltfile +0 -0
- {metaflow-2.15.19.data → metaflow-2.15.20.data}/data/share/metaflow/devtools/pick_services.sh +0 -0
- {metaflow-2.15.19.dist-info → metaflow-2.15.20.dist-info}/WHEEL +0 -0
- {metaflow-2.15.19.dist-info → metaflow-2.15.20.dist-info}/entry_points.txt +0 -0
- {metaflow-2.15.19.dist-info → metaflow-2.15.20.dist-info}/licenses/LICENSE +0 -0
- {metaflow-2.15.19.dist-info → metaflow-2.15.20.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any, Dict,
|
1
|
+
from typing import Any, Dict, Optional, Union
|
2
2
|
|
3
3
|
from metaflow.metaflow_config import DEFAULT_SECRETS_ROLE
|
4
4
|
from metaflow.exception import MetaflowException
|
@@ -6,55 +6,44 @@ from metaflow.plugins.secrets.secrets_spec import SecretSpec
|
|
6
6
|
from metaflow.plugins.secrets.utils import get_secrets_backend_provider
|
7
7
|
|
8
8
|
|
9
|
-
def
|
10
|
-
|
11
|
-
) -> Dict[
|
9
|
+
def get_secret(
|
10
|
+
source: Union[str, Dict[str, Any]], role: Optional[str] = None
|
11
|
+
) -> Dict[str, str]:
|
12
12
|
"""
|
13
|
-
Get
|
13
|
+
Get secret from source
|
14
14
|
|
15
15
|
Parameters
|
16
16
|
----------
|
17
|
-
|
18
|
-
|
17
|
+
source : Union[str, Dict[str, Any]]
|
18
|
+
Secret spec, defining how the secret is to be retrieved
|
19
19
|
role : str, optional
|
20
20
|
Role to use for fetching secrets
|
21
21
|
"""
|
22
22
|
if role is None:
|
23
23
|
role = DEFAULT_SECRETS_ROLE
|
24
24
|
|
25
|
-
|
26
|
-
all_secrets = []
|
27
|
-
secret_specs = []
|
25
|
+
secret_spec = None
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
SecretSpec.secret_spec_from_dict(secret_spec_str_or_dict, role=role)
|
37
|
-
)
|
38
|
-
else:
|
39
|
-
raise MetaflowException(
|
40
|
-
"get_secrets sources items must be either a string or a dict"
|
41
|
-
)
|
42
|
-
|
43
|
-
for secret_spec in secret_specs:
|
44
|
-
secrets_backend_provider = get_secrets_backend_provider(
|
45
|
-
secret_spec.secrets_backend_type
|
27
|
+
if isinstance(source, str):
|
28
|
+
secret_spec = SecretSpec.secret_spec_from_str(source, role=role)
|
29
|
+
elif isinstance(source, dict):
|
30
|
+
secret_spec = SecretSpec.secret_spec_from_dict(source, role=role)
|
31
|
+
else:
|
32
|
+
raise MetaflowException(
|
33
|
+
"get_secrets sources items must be either a string or a dict"
|
46
34
|
)
|
47
|
-
try:
|
48
|
-
dict_for_secret = secrets_backend_provider.get_secret_as_dict(
|
49
|
-
secret_spec.secret_id,
|
50
|
-
options=secret_spec.options,
|
51
|
-
role=secret_spec.role,
|
52
|
-
)
|
53
|
-
except Exception as e:
|
54
|
-
raise MetaflowException(
|
55
|
-
"Failed to retrieve secret '%s': %s" % (secret_spec.secret_id, e)
|
56
|
-
)
|
57
|
-
|
58
|
-
all_secrets.append((secret_spec, dict_for_secret))
|
59
35
|
|
60
|
-
|
36
|
+
secrets_backend_provider = get_secrets_backend_provider(
|
37
|
+
secret_spec.secrets_backend_type
|
38
|
+
)
|
39
|
+
try:
|
40
|
+
dict_for_secret = secrets_backend_provider.get_secret_as_dict(
|
41
|
+
secret_spec.secret_id,
|
42
|
+
options=secret_spec.options,
|
43
|
+
role=secret_spec.role,
|
44
|
+
)
|
45
|
+
return dict_for_secret
|
46
|
+
except Exception as e:
|
47
|
+
raise MetaflowException(
|
48
|
+
"Failed to retrieve secret '%s': %s" % (secret_spec.secret_id, e)
|
49
|
+
)
|
metaflow/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
metaflow_version = "2.15.
|
1
|
+
metaflow_version = "2.15.20"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: metaflow
|
3
|
-
Version: 2.15.
|
3
|
+
Version: 2.15.20
|
4
4
|
Summary: Metaflow: More AI and ML, Less Engineering
|
5
5
|
Author: Metaflow Developers
|
6
6
|
Author-email: help@metaflow.org
|
@@ -26,7 +26,7 @@ License-File: LICENSE
|
|
26
26
|
Requires-Dist: requests
|
27
27
|
Requires-Dist: boto3
|
28
28
|
Provides-Extra: stubs
|
29
|
-
Requires-Dist: metaflow-stubs==2.15.
|
29
|
+
Requires-Dist: metaflow-stubs==2.15.20; extra == "stubs"
|
30
30
|
Dynamic: author
|
31
31
|
Dynamic: author-email
|
32
32
|
Dynamic: classifier
|
@@ -37,7 +37,7 @@ metaflow/tuple_util.py,sha256=_G5YIEhuugwJ_f6rrZoelMFak3DqAR2tt_5CapS1XTY,830
|
|
37
37
|
metaflow/unbounded_foreach.py,sha256=p184WMbrMJ3xKYHwewj27ZhRUsSj_kw1jlye5gA9xJk,387
|
38
38
|
metaflow/util.py,sha256=MCXCjcGwpuR7y9euBf1GTNRHPtlh6fCpdPMEtbULefw,14554
|
39
39
|
metaflow/vendor.py,sha256=EDZokNMrx1PU07jNMiWFMFtC7TL03pMXZ1kKn13k-2g,5139
|
40
|
-
metaflow/version.py,sha256=
|
40
|
+
metaflow/version.py,sha256=yAEl3l0q7oZN97PRf8nQAkTo0CFDR10R54vM0qita1I,29
|
41
41
|
metaflow/_vendor/__init__.py,sha256=y_CiwUD3l4eAKvTVDZeqgVujMy31cAM1qjAB-HfI-9s,353
|
42
42
|
metaflow/_vendor/typing_extensions.py,sha256=q9zxWa6p6CzF1zZvSkygSlklduHf_b3K7MCxGz7MJRc,134519
|
43
43
|
metaflow/_vendor/zipp.py,sha256=ajztOH-9I7KA_4wqDYygtHa6xUBVZgFpmZ8FE74HHHI,8425
|
@@ -340,10 +340,10 @@ metaflow/plugins/pypi/pip.py,sha256=WhPyA18RoVT40sqbZRJdCEij4euL9PZwLfm1SrAKqmU,
|
|
340
340
|
metaflow/plugins/pypi/pypi_decorator.py,sha256=ybNgo-T5Z_0W2KNuED0pdjyI0qygZ4a1MXAzKqdHt_E,7250
|
341
341
|
metaflow/plugins/pypi/pypi_environment.py,sha256=FYMg8kF3lXqcLfRYWD83a9zpVjcoo_TARqMGZ763rRk,230
|
342
342
|
metaflow/plugins/pypi/utils.py,sha256=W8OhDrhz7YIE-2MSSN5Rj7AmESwsN5YDmdnro152J4w,3551
|
343
|
-
metaflow/plugins/secrets/__init__.py,sha256=
|
343
|
+
metaflow/plugins/secrets/__init__.py,sha256=hKwDnaMAG7Rjqv-chN4OjWy6G2dkncRjK_wDewthvL8,349
|
344
344
|
metaflow/plugins/secrets/inline_secrets_provider.py,sha256=EChmoBGA1i7qM3jtYwPpLZDBybXLergiDlN63E0u3x8,294
|
345
345
|
metaflow/plugins/secrets/secrets_decorator.py,sha256=mZFZgUgDl1k4q5iwO6i8Q9UhqOVYxgMciZrI9siGFJ8,4817
|
346
|
-
metaflow/plugins/secrets/secrets_func.py,sha256=
|
346
|
+
metaflow/plugins/secrets/secrets_func.py,sha256=zjDJdJLiKJfcvKzzkDbnbQCPUoCmr8q4xgPRha0lWF8,1549
|
347
347
|
metaflow/plugins/secrets/secrets_spec.py,sha256=rZCBd7Til5laiXCaYLz4izwvM8aQ3__wgBkB-c8X4fA,4251
|
348
348
|
metaflow/plugins/secrets/utils.py,sha256=Pxx1iiYRitKQIwJeCnTtV4-IrACMI5aSaUkefKF9E7Y,2669
|
349
349
|
metaflow/plugins/uv/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -398,12 +398,12 @@ metaflow/user_configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
398
398
|
metaflow/user_configs/config_decorators.py,sha256=n4OTbfuaXejPVLHnXXgVlNJNcrSvWrVOdXCMcqvQlik,20512
|
399
399
|
metaflow/user_configs/config_options.py,sha256=yyaiKLB4QWlR5AaTg9I7GoBv-OlffOFdGPe1BL85Llc,21241
|
400
400
|
metaflow/user_configs/config_parameters.py,sha256=Eyiqcz4YV_z4algDHAh2gaejGFgIdHk8Vix9AUdPSh0,20989
|
401
|
-
metaflow-2.15.
|
402
|
-
metaflow-2.15.
|
403
|
-
metaflow-2.15.
|
404
|
-
metaflow-2.15.
|
405
|
-
metaflow-2.15.
|
406
|
-
metaflow-2.15.
|
407
|
-
metaflow-2.15.
|
408
|
-
metaflow-2.15.
|
409
|
-
metaflow-2.15.
|
401
|
+
metaflow-2.15.20.data/data/share/metaflow/devtools/Makefile,sha256=5n89OGIC_kE4wxtEI66VCucN-b-1w5bqvGeZYmeRGz8,13737
|
402
|
+
metaflow-2.15.20.data/data/share/metaflow/devtools/Tiltfile,sha256=I55XTG4RBnrMfDcYRtREXqqS8T9bF8agkZq0DlvdFLk,21404
|
403
|
+
metaflow-2.15.20.data/data/share/metaflow/devtools/pick_services.sh,sha256=DCnrMXwtApfx3B4S-YiZESMyAFHbXa3VuNL0MxPLyiE,2196
|
404
|
+
metaflow-2.15.20.dist-info/licenses/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
|
405
|
+
metaflow-2.15.20.dist-info/METADATA,sha256=tAKXcb_FuUTsY5i6xzFINdY71nJ8j4GY6WVxb2CQ79E,6742
|
406
|
+
metaflow-2.15.20.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
407
|
+
metaflow-2.15.20.dist-info/entry_points.txt,sha256=RvEq8VFlgGe_FfqGOZi0D7ze1hLD0pAtXeNyGfzc_Yc,103
|
408
|
+
metaflow-2.15.20.dist-info/top_level.txt,sha256=v1pDHoWaSaKeuc5fKTRSfsXCKSdW1zvNVmvA-i0if3o,9
|
409
|
+
metaflow-2.15.20.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{metaflow-2.15.19.data → metaflow-2.15.20.data}/data/share/metaflow/devtools/pick_services.sh
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|