truefoundry 0.10.4rc2__py3-none-any.whl → 0.10.4rc3__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.
Potentially problematic release.
This version of truefoundry might be problematic. Click here for more details.
- truefoundry/deploy/python_deploy_codegen.py +26 -9
- {truefoundry-0.10.4rc2.dist-info → truefoundry-0.10.4rc3.dist-info}/METADATA +1 -1
- {truefoundry-0.10.4rc2.dist-info → truefoundry-0.10.4rc3.dist-info}/RECORD +5 -5
- {truefoundry-0.10.4rc2.dist-info → truefoundry-0.10.4rc3.dist-info}/WHEEL +0 -0
- {truefoundry-0.10.4rc2.dist-info → truefoundry-0.10.4rc3.dist-info}/entry_points.txt +0 -0
|
@@ -2,7 +2,7 @@ import ast
|
|
|
2
2
|
import io
|
|
3
3
|
import json
|
|
4
4
|
import re
|
|
5
|
-
from typing import Dict, List, Optional
|
|
5
|
+
from typing import Any, Dict, List, Optional
|
|
6
6
|
|
|
7
7
|
from rich.console import Console
|
|
8
8
|
from rich.pretty import pprint
|
|
@@ -17,7 +17,7 @@ def generate_deployment_code(
|
|
|
17
17
|
spec_repr: str,
|
|
18
18
|
workspace_fqn: str,
|
|
19
19
|
):
|
|
20
|
-
symbols = ",".join(symbols_to_import)
|
|
20
|
+
symbols = ", ".join(symbols_to_import)
|
|
21
21
|
application_type = application_type.replace(" ", "").replace("-", "_")
|
|
22
22
|
code = f"""\
|
|
23
23
|
import logging
|
|
@@ -72,7 +72,7 @@ def remove_none_type_fields(code):
|
|
|
72
72
|
|
|
73
73
|
def remove_type_field(code):
|
|
74
74
|
lines = code.split("\n")
|
|
75
|
-
new_lines = [re.sub(r'^[ \t]*type=[\'"][^"]*[\'"]
|
|
75
|
+
new_lines = [re.sub(r'^[ \t]*type=[\'"][^"]*[\'"],?', "", line) for line in lines]
|
|
76
76
|
return "\n".join(new_lines)
|
|
77
77
|
|
|
78
78
|
|
|
@@ -143,15 +143,32 @@ def _convert_deployment_config_to_python(workspace_fqn: str, application_spec: d
|
|
|
143
143
|
return generated_code
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
def convert_deployment_config_to_python(
|
|
146
|
+
def convert_deployment_config_to_python(
|
|
147
|
+
workspace_fqn: str,
|
|
148
|
+
application_spec: Dict[str, Any],
|
|
149
|
+
exclude_unset: bool = False,
|
|
150
|
+
exclude_defaults: bool = False,
|
|
151
|
+
):
|
|
147
152
|
original_repr_args = BaseModel.__repr_args__
|
|
148
153
|
|
|
149
154
|
def _patched_repr_args(self: BaseModel):
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if name
|
|
154
|
-
|
|
155
|
+
_missing = object()
|
|
156
|
+
pairs = []
|
|
157
|
+
for name, value in original_repr_args(self):
|
|
158
|
+
if name is not None:
|
|
159
|
+
model_field = self.__fields__.get(name)
|
|
160
|
+
if model_field is None:
|
|
161
|
+
continue
|
|
162
|
+
if exclude_unset and name not in self.__fields_set__:
|
|
163
|
+
continue
|
|
164
|
+
if (
|
|
165
|
+
exclude_defaults
|
|
166
|
+
and not getattr(model_field, "required", True)
|
|
167
|
+
and getattr(model_field, "default", _missing) == value
|
|
168
|
+
):
|
|
169
|
+
continue
|
|
170
|
+
pairs.append((name, value))
|
|
171
|
+
return pairs
|
|
155
172
|
|
|
156
173
|
try:
|
|
157
174
|
BaseModel.__repr_args__ = _patched_repr_args
|
|
@@ -53,7 +53,7 @@ truefoundry/common/types.py,sha256=BMJFCsR1lPJAw66IQBSvLyV4I6o_x5oj78gVsUa9si8,1
|
|
|
53
53
|
truefoundry/common/utils.py,sha256=j3QP0uOsaGD_VmDDR68JTwoYE1okkAq6OqpVkzVf48Q,6424
|
|
54
54
|
truefoundry/common/warnings.py,sha256=rs6BHwk7imQYedo07iwh3TWEOywAR3Lqhj0AY4khByg,504
|
|
55
55
|
truefoundry/deploy/__init__.py,sha256=2GNbI8IGJBotz_IKaqQ-DWYWZn_pSu7lN7aId15Gk7Q,2799
|
|
56
|
-
truefoundry/deploy/python_deploy_codegen.py,sha256=
|
|
56
|
+
truefoundry/deploy/python_deploy_codegen.py,sha256=X6cSGQ9_9GxrgIlTLvBWMDz9QnU7hrxieMIutNJe_ng,7784
|
|
57
57
|
truefoundry/deploy/_autogen/models.py,sha256=xt-DuaRDx5jeRwyGoQH2yyPZAep9Q2MHFW9XBuRzG8E,73161
|
|
58
58
|
truefoundry/deploy/builder/__init__.py,sha256=kgvlkVkiWpMVdim81tIeLrdoACqrFDgwCqHdQVsCsMo,4988
|
|
59
59
|
truefoundry/deploy/builder/constants.py,sha256=amUkHoHvVKzGv0v_knfiioRuKiJM0V0xW0diERgWiI0,508
|
|
@@ -381,7 +381,7 @@ truefoundry/workflow/remote_filesystem/__init__.py,sha256=LQ95ViEjJ7Ts4JcCGOxMPs
|
|
|
381
381
|
truefoundry/workflow/remote_filesystem/logger.py,sha256=em2l7D6sw7xTLDP0kQSLpgfRRCLpN14Qw85TN7ujQcE,1022
|
|
382
382
|
truefoundry/workflow/remote_filesystem/tfy_signed_url_client.py,sha256=xcT0wQmQlgzcj0nP3tJopyFSVWT1uv3nhiTIuwfXYeg,12342
|
|
383
383
|
truefoundry/workflow/remote_filesystem/tfy_signed_url_fs.py,sha256=nSGPZu0Gyd_jz0KsEE-7w_BmnTD8CVF1S8cUJoxaCbc,13305
|
|
384
|
-
truefoundry-0.10.
|
|
385
|
-
truefoundry-0.10.
|
|
386
|
-
truefoundry-0.10.
|
|
387
|
-
truefoundry-0.10.
|
|
384
|
+
truefoundry-0.10.4rc3.dist-info/METADATA,sha256=DvsgKrey42e5PHmRKl107ZHQeOO-uqsRX-OG7tibhiI,2508
|
|
385
|
+
truefoundry-0.10.4rc3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
386
|
+
truefoundry-0.10.4rc3.dist-info/entry_points.txt,sha256=xVjn7RMN-MW2-9f7YU-bBdlZSvvrwzhpX1zmmRmsNPU,98
|
|
387
|
+
truefoundry-0.10.4rc3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|